aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorMartin Rudalics2020-04-06 09:22:36 +0200
committerMartin Rudalics2020-04-06 09:22:36 +0200
commitc49d379f17bcb0ce82604def2eaa04bda00bd5ec (patch)
treee33f6534413fb16a198739c0ca3f160a28a5edd3 /src/xterm.c
parent6de20c7eab0dd8360e78d744dbf62aecc7f78281 (diff)
downloademacs-c49d379f17bcb0ce82604def2eaa04bda00bd5ec.tar.gz
emacs-c49d379f17bcb0ce82604def2eaa04bda00bd5ec.zip
Fix some problems with moving and resizing child frames
(1) Provide new option 'x-gtk-resize-child-frames' which allows to either hide a child frame during resizing or asks GTK to resize it "immediately". This is needed because desktops like GNOME shell otherwise won't allow resizing child frames at all. (2) Do not try to synchronize the position of a child frame after moving it. Needed because the present implementation introduces a 0.5 secs delay which makes dragging child frames virtually impossible with Lucid and Motif toolkits on desktops like GNOME shell that use invisible outer frame borders. For further information see the thread starting with https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00343.html * src/frame.c (syms_of_frame): New symbol Qxg_frame_set_char_size_4. * src/gtkutil.c (xg_frame_set_char_size): Hide child frame during resizing when 'x-gtk-resize-child-frames' equals 'hide'. * src/xfns.c (x_set_parent_frame, Fx_create_frame): Set gtk_container_resize_mode to GTK_RESIZE_IMMEDIATE for child frames when'x-gtk-resize-child-frames' equals 'resize-mode'. (Fx_gtk_debug): New function to toggle interactive GTK debugging from within Emacs. (syms_of_xfns): New symbols Qhide and Qresize_mode. (x-gtk-resize-child-frames): New option that allows to resize child frames on desktops like GNOME shell (with the mutter WM) that otherwise refuse to resize them. * src/xterm.c (x_set_offset): Don't x_sync_with_move for child frames, it makes moving child frames virtually impossible with the Lucid and Motif toolkits.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/xterm.c b/src/xterm.c
index bda976fcbbd..44396955ed0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10608,26 +10608,29 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
10608 modified_left, modified_top); 10608 modified_left, modified_top);
10609#endif 10609#endif
10610 10610
10611 x_sync_with_move (f, f->left_pos, f->top_pos, 10611 /* 'x_sync_with_move' is too costly for dragging child frames. */
10612 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN); 10612 if (!FRAME_PARENT_FRAME (f))
10613 10613 {
10614 /* change_gravity is non-zero when this function is called from Lisp to 10614 x_sync_with_move (f, f->left_pos, f->top_pos,
10615 programmatically move a frame. In that case, we call 10615 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN);
10616 x_check_expected_move to discover if we have a "Type A" or "Type B" 10616
10617 window manager, and, for a "Type A" window manager, adjust the position 10617 /* change_gravity is non-zero when this function is called from Lisp to
10618 of the frame. 10618 programmatically move a frame. In that case, we call
10619 10619 x_check_expected_move to discover if we have a "Type A" or "Type B"
10620 We call x_check_expected_move if a programmatic move occurred, and 10620 window manager, and, for a "Type A" window manager, adjust the position
10621 either the window manager type (A/B) is unknown or it is Type A but we 10621 of the frame.
10622 need to compute the top/left offset adjustment for this frame. */ 10622
10623 10623 We call x_check_expected_move if a programmatic move occurred, and
10624 if (change_gravity != 0 10624 either the window manager type (A/B) is unknown or it is Type A but we
10625 && !FRAME_PARENT_FRAME (f) 10625 need to compute the top/left offset adjustment for this frame. */
10626 && (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN 10626
10627 || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A 10627 if (change_gravity != 0
10628 && (FRAME_X_OUTPUT (f)->move_offset_left == 0 10628 && (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
10629 && FRAME_X_OUTPUT (f)->move_offset_top == 0)))) 10629 || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A
10630 x_check_expected_move (f, modified_left, modified_top); 10630 && (FRAME_X_OUTPUT (f)->move_offset_left == 0
10631 && FRAME_X_OUTPUT (f)->move_offset_top == 0))))
10632 x_check_expected_move (f, modified_left, modified_top);
10633 }
10631 10634
10632 unblock_input (); 10635 unblock_input ();
10633} 10636}