aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorMartin Rudalics2017-04-11 12:37:26 +0200
committerMartin Rudalics2017-04-11 12:37:26 +0200
commitea6c880aa68bcc8f0e388ecbd8c552392488b38f (patch)
treec4da212b292347d6668dc6283f8444fc795f6e2c /src/xterm.c
parent0eef8e9af7707b7bd01243033b9a48cb74fb8672 (diff)
downloademacs-ea6c880aa68bcc8f0e388ecbd8c552392488b38f.tar.gz
emacs-ea6c880aa68bcc8f0e388ecbd8c552392488b38f.zip
Frame movement, focus and hook related changes
New hook `move-frame-functions'. Run `focus-in-hook' after switching to frame that gets focus. Don't run XMoveWindow for GTK. * lisp/frame.el (handle-move-frame, frame-size-changed-p): New functions. * src/frame.c (do_switch_frame): Simplify code. (Fhandle_switch_frame): Switch frame before running `handle-focus-in'. (Vfocus_in_hook, Vfocus_out_hook): Clarify doc-strings. (Vmove_frame_functions): New hook variable. * src/keyboard.c (kbd_buffer_get_event): Handle MOVE_FRAME_EVENT. Handle SELECT_WINDOW_EVENT separately. (head_table): Add Qmove_frame entry. (syms_of_keyboard): Add Qmove_frame. (keys_of_keyboard): Define key for `move-frame'. * src/termhooks.h (event_kind): Add MOVE_FRAME_EVENT. * src/w32term.c (w32_read_socket): Create MOVE_FRAME_EVENT. * src/window.c (run_window_size_change_functions): Record size of FRAME's minibuffer window too. * src/xterm.c (handle_one_xevent): Create MOVE_FRAME_EVENT. (x_set_offset): For GTK call gtk_widget_move instead of XMoveWindow.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 08ccac07005..1d14407aa43 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8614,7 +8614,22 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8614 if (FRAME_GTK_OUTER_WIDGET (f) 8614 if (FRAME_GTK_OUTER_WIDGET (f)
8615 && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f))) 8615 && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f)))
8616#endif 8616#endif
8617 x_real_positions (f, &f->left_pos, &f->top_pos); 8617 {
8618 int old_left = f->left_pos;
8619 int old_top = f->top_pos;
8620 Lisp_Object frame = Qnil;
8621
8622 XSETFRAME (frame, f);
8623
8624 x_real_positions (f, &f->left_pos, &f->top_pos);
8625
8626 if (old_left != f->left_pos || old_top != f->top_pos)
8627 {
8628 inev.ie.kind = MOVE_FRAME_EVENT;
8629 XSETFRAME (inev.ie.frame_or_window, f);
8630 }
8631 }
8632
8618 8633
8619#ifdef HAVE_X_I18N 8634#ifdef HAVE_X_I18N
8620 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea)) 8635 if (FRAME_XIC (f) && (FRAME_XIC_STYLE (f) & XIMStatusArea))
@@ -10088,8 +10103,13 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
10088 modified_top += FRAME_X_OUTPUT (f)->move_offset_top; 10103 modified_top += FRAME_X_OUTPUT (f)->move_offset_top;
10089 } 10104 }
10090 10105
10106#ifdef USE_GTK
10107 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
10108 modified_left, modified_top);
10109#else
10091 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 10110 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
10092 modified_left, modified_top); 10111 modified_left, modified_top);
10112#endif
10093 10113
10094 x_sync_with_move (f, f->left_pos, f->top_pos, 10114 x_sync_with_move (f, f->left_pos, f->top_pos,
10095 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN); 10115 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN);