summaryrefslogtreecommitdiff
path: root/src/w32term.c
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2017-04-12 18:22:44 +0200
committerMartin Rudalics <rudalics@gmx.at>2017-04-12 18:22:44 +0200
commitc25005eda1c5ad8dabb3ce815658bd3c637ae686 (patch)
treed4c7e6bd2d2a9fe8cdc3345a0f84d6d0aa6d4987 /src/w32term.c
parent8720f601e715e5f1d41f7cf863a525a1cc1bc12c (diff)
downloademacs-c25005eda1c5ad8dabb3ce815658bd3c637ae686.tar.gz
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.c35
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)
block_input ();
{
HDC hdc = get_frame_dc (f);
- w32_clear_area (f, hdc, 0, y, width, height);
- w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width,
- y, width, height);
+ struct face *face = FACE_FROM_ID_OR_NULL (f, INTERNAL_BORDER_FACE_ID);
+
+ if (face)
+ {
+ /* Fill border with internal border face. */
+ unsigned long color = face->background;
+
+ w32_fill_area (f, hdc, color, 0, y, width, height);
+ w32_fill_area (f, hdc, color, FRAME_PIXEL_WIDTH (f) - width,
+ y, width, height);
+ }
+ else
+ {
+ w32_clear_area (f, hdc, 0, y, width, height);
+ w32_clear_area (f, hdc, FRAME_PIXEL_WIDTH (f) - width,
+ y, width, height);
+ }
release_frame_dc (f, hdc);
}
unblock_input ();
@@ -3908,6 +3922,7 @@ w32_set_vertical_scroll_bar (struct window *w,
for them on the frame, we have to clear "under" them. */
w32_clear_area (f, hdc, left, top, width, height);
release_frame_dc (f, hdc);
+ x_clear_under_internal_border (f);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
@@ -4009,6 +4024,7 @@ w32_set_horizontal_scroll_bar (struct window *w,
for them on the frame, we have to clear "under" them. */
w32_clear_area (f, hdc, clear_left, top, clear_width, height);
release_frame_dc (f, hdc);
+ x_clear_under_internal_border (f);
}
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
@@ -4553,6 +4569,7 @@ x_scroll_bar_clear (struct frame *f)
GetClientRect (window, &rect);
select_palette (f, hdc);
w32_clear_rect (f, hdc, &rect);
+ x_clear_under_internal_border (f);
deselect_palette (f, hdc);
ReleaseDC (window, hdc);
@@ -4682,6 +4699,7 @@ w32_read_socket (struct terminal *terminal,
msg.rect.top,
msg.rect.right - msg.rect.left,
msg.rect.bottom - msg.rect.top);
+ x_clear_under_internal_border (f);
}
}
break;
@@ -5118,6 +5136,9 @@ w32_read_socket (struct terminal *terminal,
}
#endif
+ if (f = x_window_to_frame (dpyinfo, msg.msg.hwnd))
+ x_clear_under_internal_border (f);
+
check_visibility = 1;
break;
@@ -6392,10 +6413,14 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
}
-/* focus shifting, raising and lowering. */
+/* Focus shifting, raising and lowering. */
+
+/* The NOACTIVATE argument has no effect on Windows. According to the
+ Windows API: An application cannot activate an inactive window
+ without also bringing it to the top of the Z order. */
void
-x_focus_frame (struct frame *f)
+x_focus_frame (struct frame *f, bool noactivate)
{
#if 0
struct w32_display_info *dpyinfo = &one_w32_display_info;