diff options
author | Martin Rudalics <rudalics@gmx.at> | 2021-05-12 09:44:02 +0200 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2021-05-12 09:44:02 +0200 |
commit | b41f39d22cdb921fe88311f4fd113cbb9c2f0c76 (patch) | |
tree | 6bdb2ec7ead4dace5a00914a12b2b90e3a7921f9 /src/frame.c | |
parent | 47070ed39eda524d334e5f82dc7f4a50b8d3252c (diff) | |
download | emacs-b41f39d22cdb921fe88311f4fd113cbb9c2f0c76.tar.gz emacs-b41f39d22cdb921fe88311f4fd113cbb9c2f0c76.tar.bz2 emacs-b41f39d22cdb921fe88311f4fd113cbb9c2f0c76.zip |
Handle Bug#24526 without breaking Emacs on tiling WMs (Bug#48268)
Since tiling window managers may react allergically to resize
requests immediately following MapNotify events on X, make sure
that such requests are issued only when a new frame should not
become visible and a size has been explicitly requested for it.
* lisp/faces.el (x-create-frame-with-faces): Mark frame as
'was-invisible' if it should be initially invisible or iconified
and has its size specified explicitly.
* src/frame.c (make_frame): Initialize new frame's was_invisible
flag.
(Fframe__set_was_invisible): New internal function.
* src/frame.h (struct frame): Specify size of new_size_p slot.
New flag was_invisible.
* src/w32fns.c (Fx_create_frame)
* src/nsfns.m (Fx_create_frame)
* src/xfns.c (Fx_create_frame): Set new frame's was_invisible
flag.
* src/xterm.c (handle_one_xevent): Call xg_frame_set_char_size
after a PropertyNotify or MapNotify event only if F's
was_invisible flag was set.
Diffstat (limited to 'src/frame.c')
-rw-r--r-- | src/frame.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index cb9d4f52109..e3d65dd28f3 100644 --- a/src/frame.c +++ b/src/frame.c @@ -971,6 +971,7 @@ make_frame (bool mini_p) f->no_accept_focus = false; f->z_group = z_group_none; f->tooltip = false; + f->was_invisible = false; f->child_frame_border_width = -1; f->last_tab_bar_item = -1; #ifndef HAVE_EXT_TOOL_BAR @@ -5855,7 +5856,18 @@ selected frame. This is useful when `make-pointer-invisible' is set. */) return decode_any_frame (frame)->pointer_invisible ? Qnil : Qt; } +DEFUN ("frame--set-was-invisible", Fframe__set_was_invisible, + Sframe__set_was_invisible, 2, 2, 0, + doc: /* Set FRAME's was-invisible flag if WAS-INVISIBLE is non-nil. +This function is for internal use only. */) + (Lisp_Object frame, Lisp_Object was_invisible) +{ + struct frame *f = decode_live_frame (frame); + f->was_invisible = !NILP (was_invisible); + + return f->was_invisible ? Qt : Qnil; +} /*********************************************************************** Multimonitor data @@ -6495,6 +6507,7 @@ iconify the top level frame instead. */); defsubr (&Sframe_position); defsubr (&Sset_frame_position); defsubr (&Sframe_pointer_visible_p); + defsubr (&Sframe__set_was_invisible); defsubr (&Sframe_window_state_change); defsubr (&Sset_frame_window_state_change); defsubr (&Sframe_scale_factor); |