diff options
| author | Martin Rudalics | 2017-04-11 12:37:26 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2017-04-11 12:37:26 +0200 |
| commit | ea6c880aa68bcc8f0e388ecbd8c552392488b38f (patch) | |
| tree | c4da212b292347d6668dc6283f8444fc795f6e2c /src/window.c | |
| parent | 0eef8e9af7707b7bd01243033b9a48cb74fb8672 (diff) | |
| download | emacs-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/window.c')
| -rw-r--r-- | src/window.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index 95690443f8e..58c0c33cbb0 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3314,6 +3314,9 @@ run_window_size_change_functions (Lisp_Object frame) | |||
| 3314 | Lisp_Object functions = Vwindow_size_change_functions; | 3314 | Lisp_Object functions = Vwindow_size_change_functions; |
| 3315 | 3315 | ||
| 3316 | if (FRAME_WINDOW_CONFIGURATION_CHANGED (f) | 3316 | if (FRAME_WINDOW_CONFIGURATION_CHANGED (f) |
| 3317 | /* Here we implicitly exclude the possibility that the height of | ||
| 3318 | FRAME and its minibuffer window both change leaving the height | ||
| 3319 | of FRAME's root window alone. */ | ||
| 3317 | || window_size_changed (r)) | 3320 | || window_size_changed (r)) |
| 3318 | { | 3321 | { |
| 3319 | while (CONSP (functions)) | 3322 | while (CONSP (functions)) |
| @@ -3324,6 +3327,12 @@ run_window_size_change_functions (Lisp_Object frame) | |||
| 3324 | } | 3327 | } |
| 3325 | 3328 | ||
| 3326 | window_set_before_size_change_sizes (r); | 3329 | window_set_before_size_change_sizes (r); |
| 3330 | |||
| 3331 | if (FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f)) | ||
| 3332 | /* Record size of FRAME's minibuffer window too. */ | ||
| 3333 | window_set_before_size_change_sizes | ||
| 3334 | (XWINDOW (FRAME_MINIBUF_WINDOW (f))); | ||
| 3335 | |||
| 3327 | FRAME_WINDOW_CONFIGURATION_CHANGED (f) = false; | 3336 | FRAME_WINDOW_CONFIGURATION_CHANGED (f) = false; |
| 3328 | } | 3337 | } |
| 3329 | } | 3338 | } |