diff options
| author | Martin Rudalics | 2017-04-12 18:22:44 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2017-04-12 18:22:44 +0200 |
| commit | c25005eda1c5ad8dabb3ce815658bd3c637ae686 (patch) | |
| tree | d4c7e6bd2d2a9fe8cdc3345a0f84d6d0aa6d4987 /src/w32term.c | |
| parent | 8720f601e715e5f1d41f7cf863a525a1cc1bc12c (diff) | |
| download | emacs-c25005eda1c5ad8dabb3ce815658bd3c637ae686.tar.gz emacs-c25005eda1c5ad8dabb3ce815658bd3c637ae686.zip | |
New internal-border face and args for select-window and x-focus-frame
Add `internal-border' face and handle it whenever clearing the
internal border. If NORECORD equals the symbol
'mark-for-redisplay', `select-window' will not record the window
but still mark it for redisplay. The new argument NOACTIVATE
for `x-focus-frame' tries to not activate FRAME when set.
* lisp/faces.el (internal-border): New face.
* lisp/mwheel.el (mwheel-scroll): Select window to scroll with
`mark-for-redisplay'.
* lisp/scroll-bar.el (scroll-bar-drag)
(scroll-bar-horizontal-drag, scroll-bar-scroll-down)
(scroll-bar-scroll-up, scroll-bar-toolkit-scroll)
(scroll-bar-toolkit-horizontal-scroll): Select window to scroll
with `mark-for-redisplay'.
* lisp/window.el (handle-select-window): When
`focus-follows-mouse' is not 'auto-raise' try to not activate
FRAME.
* src/dispextern.h (face_id): Add INTERNAL_BORDER_FACE_ID.
* src/frame.c (Fx_focus_frame): New argument NOACTIVATE.
* src/frame.h (x_focus_frame): Update extern declaration.
* src/gtkutil.c (xg_clear_under_internal_border): Remove
function.
(xg_frame_resized, xg_frame_set_char_size): Call
x_clear_under_internal_border.
(xg_tool_bar_callback): Adapt x_focus_frame call.
* src/gtkutil.h (xg_clear_under_internal_border): Remove
declaration.
* src/nsfns.m (x_focus_frame): Add argument NOACTIVATE.
* src/w32fns.c (x_clear_under_internal_border): Fill border
with internal-border background if specified.
* src/w32term.h (x_clear_under_internal_border): Add extern
declaration.
* src/w32term.c (x_after_update_window_line): Fill border
with internal-border background if specified.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar)
(x_scroll_bar_clear, w32_read_socket): Call
x_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE.
* src/window.c (select_window): Mark WINDOW for redisplay when
NORECORD equals 'mark-for-redisplay'.
(Fselect_window): Update doc-string.
(syms_of_window): Define Qmark_for_redisplay.
* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(redisplay_internal): Call x_clear_under_internal_border.
* src/xfaces.c (lookup_basic_face): Handle `window-divider'
and `internal-border' faces.
(realize_basic_faces): Realize `internal-border' face.
(syms_of_xfaces): Define Qinternal_border.
* src/xfns.c (x_set_internal_border_width): Remove call for
xg_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE. When non-nil try to not
activate frame.
* src/xterm.c (x_fill_rectangle): No more static.
(x_clear_under_internal_border, x_after_update_window_line):
Fill border with internal-border background if specified.
(xt_horizontal_action_hook): Rewrite.
(handle_one_xevent): Call x_clear_under_internal_border.
* src/xterm.h (x_fill_rectangle): Add extern declaration.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/w32term.c b/src/w32term.c index b50f0d39a48..1c3d243b62c 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -782,9 +782,23 @@ x_after_update_window_line (struct window *w, struct glyph_row *desired_row) | |||
| 782 | block_input (); | 782 | block_input (); |
| 783 | { | 783 | { |
| 784 | HDC hdc = get_frame_dc (f); | 784 | HDC hdc = get_frame_dc (f); |
| 785 | w32_clear_area (f, hdc, 0, y, width, height); | 785 | struct face *face = FACE_FROM_ID_OR_NULL (f, INTERNAL_BORDER_FACE_ID); |
| 786 | w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width, | 786 | |
| 787 | y, width, height); | 787 | if (face) |
| 788 | { | ||
| 789 | /* Fill border with internal border face. */ | ||
| 790 | unsigned long color = face->background; | ||
| 791 | |||
| 792 | w32_fill_area (f, hdc, color, 0, y, width, height); | ||
| 793 | w32_fill_area (f, hdc, color, FRAME_PIXEL_WIDTH (f) - width, | ||
| 794 | y, width, height); | ||
| 795 | } | ||
| 796 | else | ||
| 797 | { | ||
| 798 | w32_clear_area (f, hdc, 0, y, width, height); | ||
| 799 | w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width, | ||
| 800 | y, width, height); | ||
| 801 | } | ||
| 788 | release_frame_dc (f, hdc); | 802 | release_frame_dc (f, hdc); |
| 789 | } | 803 | } |
| 790 | unblock_input (); | 804 | unblock_input (); |
| @@ -3908,6 +3922,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3908 | for them on the frame, we have to clear "under" them. */ | 3922 | for them on the frame, we have to clear "under" them. */ |
| 3909 | w32_clear_area (f, hdc, left, top, width, height); | 3923 | w32_clear_area (f, hdc, left, top, width, height); |
| 3910 | release_frame_dc (f, hdc); | 3924 | release_frame_dc (f, hdc); |
| 3925 | x_clear_under_internal_border (f); | ||
| 3911 | } | 3926 | } |
| 3912 | /* Make sure scroll bar is "visible" before moving, to ensure the | 3927 | /* Make sure scroll bar is "visible" before moving, to ensure the |
| 3913 | area of the parent window now exposed will be refreshed. */ | 3928 | area of the parent window now exposed will be refreshed. */ |
| @@ -4009,6 +4024,7 @@ w32_set_horizontal_scroll_bar (struct window *w, | |||
| 4009 | for them on the frame, we have to clear "under" them. */ | 4024 | for them on the frame, we have to clear "under" them. */ |
| 4010 | w32_clear_area (f, hdc, clear_left, top, clear_width, height); | 4025 | w32_clear_area (f, hdc, clear_left, top, clear_width, height); |
| 4011 | release_frame_dc (f, hdc); | 4026 | release_frame_dc (f, hdc); |
| 4027 | x_clear_under_internal_border (f); | ||
| 4012 | } | 4028 | } |
| 4013 | /* Make sure scroll bar is "visible" before moving, to ensure the | 4029 | /* Make sure scroll bar is "visible" before moving, to ensure the |
| 4014 | area of the parent window now exposed will be refreshed. */ | 4030 | area of the parent window now exposed will be refreshed. */ |
| @@ -4553,6 +4569,7 @@ x_scroll_bar_clear (struct frame *f) | |||
| 4553 | GetClientRect (window, &rect); | 4569 | GetClientRect (window, &rect); |
| 4554 | select_palette (f, hdc); | 4570 | select_palette (f, hdc); |
| 4555 | w32_clear_rect (f, hdc, &rect); | 4571 | w32_clear_rect (f, hdc, &rect); |
| 4572 | x_clear_under_internal_border (f); | ||
| 4556 | deselect_palette (f, hdc); | 4573 | deselect_palette (f, hdc); |
| 4557 | 4574 | ||
| 4558 | ReleaseDC (window, hdc); | 4575 | ReleaseDC (window, hdc); |
| @@ -4682,6 +4699,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 4682 | msg.rect.top, | 4699 | msg.rect.top, |
| 4683 | msg.rect.right - msg.rect.left, | 4700 | msg.rect.right - msg.rect.left, |
| 4684 | msg.rect.bottom - msg.rect.top); | 4701 | msg.rect.bottom - msg.rect.top); |
| 4702 | x_clear_under_internal_border (f); | ||
| 4685 | } | 4703 | } |
| 4686 | } | 4704 | } |
| 4687 | break; | 4705 | break; |
| @@ -5118,6 +5136,9 @@ w32_read_socket (struct terminal *terminal, | |||
| 5118 | } | 5136 | } |
| 5119 | #endif | 5137 | #endif |
| 5120 | 5138 | ||
| 5139 | if (f = x_window_to_frame (dpyinfo, msg.msg.hwnd)) | ||
| 5140 | x_clear_under_internal_border (f); | ||
| 5141 | |||
| 5121 | check_visibility = 1; | 5142 | check_visibility = 1; |
| 5122 | break; | 5143 | break; |
| 5123 | 5144 | ||
| @@ -6392,10 +6413,14 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) | |||
| 6392 | } | 6413 | } |
| 6393 | 6414 | ||
| 6394 | 6415 | ||
| 6395 | /* focus shifting, raising and lowering. */ | 6416 | /* Focus shifting, raising and lowering. */ |
| 6417 | |||
| 6418 | /* The NOACTIVATE argument has no effect on Windows. According to the | ||
| 6419 | Windows API: An application cannot activate an inactive window | ||
| 6420 | without also bringing it to the top of the Z order. */ | ||
| 6396 | 6421 | ||
| 6397 | void | 6422 | void |
| 6398 | x_focus_frame (struct frame *f) | 6423 | x_focus_frame (struct frame *f, bool noactivate) |
| 6399 | { | 6424 | { |
| 6400 | #if 0 | 6425 | #if 0 |
| 6401 | struct w32_display_info *dpyinfo = &one_w32_display_info; | 6426 | struct w32_display_info *dpyinfo = &one_w32_display_info; |