-
Notifications
You must be signed in to change notification settings - Fork 55
Update patches for latest Emacs 31 #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
garyo
wants to merge
2
commits into
jimeh:master
Choose a base branch
from
garyo:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| diff -ur a/src/macfont.m b/src/macfont.m | ||
| --- a/src/macfont.m 2025-12-11 04:36:34 | ||
| +++ b/src/macfont.m 2025-12-11 10:21:09 | ||
| @@ -2994,9 +2994,14 @@ | ||
| CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face); | ||
| else | ||
| CG_SET_FILL_COLOR_WITH_FRAME_CURSOR (context, f); | ||
| - } | ||
| + CGContextSetAlpha (context, 1); | ||
| + } | ||
| else | ||
| - CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face); | ||
| + { | ||
| + CGContextSetAlpha (context, f->alpha_background); | ||
| + CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face); | ||
| + } | ||
| + CGContextClearRect (context, background_rect); | ||
| CGContextFillRects (context, &background_rect, 1); | ||
| } | ||
|
|
||
| @@ -3005,6 +3010,7 @@ | ||
| CGAffineTransform atfm; | ||
|
|
||
| CGContextScaleCTM (context, 1, -1); | ||
| + CGContextSetAlpha (context, 1); | ||
| if (s->hl == DRAW_CURSOR) | ||
| { | ||
| if (face && (NS_FACE_BACKGROUND (face) | ||
| diff -ur a/src/nsfns.m b/src/nsfns.m | ||
| --- a/src/nsfns.m 2025-12-11 04:36:34 | ||
| +++ b/src/nsfns.m 2025-12-11 10:25:21 | ||
| @@ -295,7 +295,7 @@ | ||
| struct face *face; | ||
| NSColor *col; | ||
| NSView *view = FRAME_NS_VIEW (f); | ||
| - EmacsCGFloat alpha; | ||
| + EmacsCGFloat alpha = f->alpha_background; | ||
|
|
||
| block_input (); | ||
| if (ns_lisp_to_color (arg, &col)) | ||
| @@ -310,11 +310,10 @@ | ||
| f->output_data.ns->background_color = col; | ||
|
|
||
| FRAME_BACKGROUND_PIXEL (f) = [col unsignedLong]; | ||
| - alpha = [col alphaComponent]; | ||
|
|
||
| if (view != nil) | ||
| { | ||
| - [[view window] setBackgroundColor: col]; | ||
| + [[view window] setBackgroundColor: [col colorWithAlphaComponent: alpha]]; | ||
|
|
||
| if (alpha != (EmacsCGFloat) 1.0) | ||
| [[view window] setOpaque: NO]; | ||
| @@ -324,10 +323,7 @@ | ||
| face = FRAME_DEFAULT_FACE (f); | ||
| if (face) | ||
| { | ||
| - col = [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]; | ||
| - face->background = [[col colorWithAlphaComponent: alpha] | ||
| - unsignedLong]; | ||
| - | ||
| + face->background = [col unsignedLong]; | ||
| update_face_from_frame_parameter (f, Qbackground_color, arg); | ||
| } | ||
|
|
||
| @@ -340,7 +336,37 @@ | ||
| unblock_input (); | ||
| } | ||
|
|
||
| +static void | ||
| +ns_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | ||
| +{ | ||
| + NSView *view = FRAME_NS_VIEW (f); | ||
| + double alpha = 1.0; | ||
|
|
||
| + if (NILP (arg)) | ||
| + alpha = 1.0; | ||
| + else if (FLOATP (arg)) | ||
| + { | ||
| + alpha = XFLOAT_DATA (arg); | ||
| + if (! (0 <= alpha && alpha <= 1.0)) | ||
| + args_out_of_range (make_float (0.0), make_float (1.0)); | ||
| + } | ||
| + else if (FIXNUMP (arg)) | ||
| + { | ||
| + EMACS_INT ialpha = XFIXNUM (arg); | ||
| + if (! (0 <= ialpha && ialpha <= 100)) | ||
| + args_out_of_range (make_fixnum (0), make_fixnum (100)); | ||
| + alpha = ialpha / 100.0; | ||
| + } | ||
| + else | ||
| + wrong_type_argument (Qnumberp, arg); | ||
| + | ||
| + f->alpha_background = alpha; | ||
| + [[view window] setBackgroundColor: [f->output_data.ns->background_color | ||
| + colorWithAlphaComponent: alpha]]; | ||
| + recompute_basic_faces (f); | ||
| + SET_FRAME_GARBAGED (f); | ||
| +} | ||
| + | ||
| static void | ||
| ns_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) | ||
| { | ||
| @@ -1105,7 +1131,7 @@ | ||
| ns_set_z_group, | ||
| 0, /* x_set_override_redirect */ | ||
| gui_set_no_special_glyphs, | ||
| - gui_set_alpha_background, | ||
| + ns_set_alpha_background, | ||
| gui_set_borders_respect_alpha_background, | ||
| NULL, | ||
| #ifdef NS_IMPL_COCOA | ||
| diff -ur a/src/nsterm.m b/src/nsterm.m | ||
| --- a/src/nsterm.m 2025-12-11 04:36:34 | ||
| +++ b/src/nsterm.m 2025-12-11 10:21:09 | ||
| @@ -2624,8 +2624,10 @@ | ||
|
|
||
| block_input (); | ||
| ns_focus (f, &r, 1); | ||
| - [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND | ||
| - (FACE_FROM_ID (f, DEFAULT_FACE_ID))] set]; | ||
| + [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND | ||
| + (FACE_FROM_ID (f, DEFAULT_FACE_ID))] | ||
| + colorWithAlphaComponent: f->alpha_background] | ||
| + set]; | ||
| NSRectFill (r); | ||
| ns_unfocus (f); | ||
|
|
||
| @@ -2653,7 +2655,8 @@ | ||
|
|
||
| r = NSIntersectionRect (r, [view frame]); | ||
| ns_focus (f, &r, 1); | ||
| - [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set]; | ||
| + [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] | ||
| + colorWithAlphaComponent: f->alpha_background] set]; | ||
|
|
||
| NSRectFill (r); | ||
|
|
||
| @@ -2757,7 +2760,8 @@ | ||
| return; | ||
|
|
||
| ns_focus (f, NULL, 1); | ||
| - [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set]; | ||
| + [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] | ||
| + colorWithAlphaComponent: f->alpha_background] set]; | ||
| NSRectFill (NSMakeRect (0, margin, width, border)); | ||
| NSRectFill (NSMakeRect (0, 0, border, height)); | ||
| NSRectFill (NSMakeRect (0, margin, width, border)); | ||
| @@ -2809,7 +2813,8 @@ | ||
| NSRect r = NSMakeRect (0, y, FRAME_PIXEL_WIDTH (f), height); | ||
| ns_focus (f, &r, 1); | ||
|
|
||
| - [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set]; | ||
| + [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] | ||
| + colorWithAlphaComponent: f->alpha_background] set]; | ||
| NSRectFill (NSMakeRect (0, y, width, height)); | ||
| NSRectFill (NSMakeRect (FRAME_PIXEL_WIDTH (f) - width, | ||
| y, width, height)); | ||
| @@ -3060,7 +3065,8 @@ | ||
| { | ||
| NSTRACE_RECT ("clearRect", bmpRect); | ||
|
|
||
| - [[NSColor colorWithUnsignedLong:face->background] set]; | ||
| + [[[NSColor colorWithUnsignedLong:face->background] | ||
| + colorWithAlphaComponent: f->alpha_background] set]; | ||
| NSRectFill (bmpRect); | ||
| } | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.