summaryrefslogtreecommitdiff
path: root/src/gtkutil.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/gtkutil.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/gtkutil.c')
-rw-r--r--src/gtkutil.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 227a062bff3..ad3590dfa66 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -835,30 +835,6 @@ xg_set_geometry (struct frame *f)
}
}
-/* Clear under internal border if any. As we use a mix of Gtk+ and X calls
- and use a GtkFixed widget, this doesn't happen automatically. */
-
-void
-xg_clear_under_internal_border (struct frame *f)
-{
- if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
- {
- x_clear_area (f, 0, 0,
- FRAME_PIXEL_WIDTH (f), FRAME_INTERNAL_BORDER_WIDTH (f));
-
- x_clear_area (f, 0, 0,
- FRAME_INTERNAL_BORDER_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
-
- x_clear_area (f, 0,
- FRAME_PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
- FRAME_PIXEL_WIDTH (f), FRAME_INTERNAL_BORDER_WIDTH (f));
-
- x_clear_area (f,
- FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
- 0, FRAME_INTERNAL_BORDER_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
- }
-}
-
static int
xg_get_gdk_scale (void)
{
@@ -905,7 +881,7 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
|| pixelwidth != FRAME_PIXEL_WIDTH (f)
|| pixelheight != FRAME_PIXEL_HEIGHT (f))
{
- xg_clear_under_internal_border (f);
+ x_clear_under_internal_border (f);
change_frame_size (f, width, height, 0, 1, 0, 1);
SET_FRAME_GARBAGED (f);
cancel_mouse_face (f);
@@ -933,7 +909,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
&gwidth, &gheight);
/* Do this before resize, as we don't know yet if we will be resized. */
- xg_clear_under_internal_border (f);
+ x_clear_under_internal_border (f);
if (FRAME_VISIBLE_P (f))
{
@@ -4361,7 +4337,7 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
/* Return focus to the frame after we have clicked on a detached
tool bar button. */
- x_focus_frame (f);
+ x_focus_frame (f, false);
}
static GtkWidget *