1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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.
This commit is contained in:
Martin Rudalics 2021-05-12 09:44:02 +02:00
parent 47070ed39e
commit b41f39d22c
7 changed files with 69 additions and 7 deletions

View file

@ -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);