diff --git a/src/frame.c b/src/frame.c index f6053fca3ef..e4787ae1bf5 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4539,7 +4539,11 @@ gui_set_frame_parameters_1 (struct frame *f, Lisp_Object alist, { Lisp_Object old_value = get_frame_param (f, Qfullscreen); - store_frame_param (f, Qfullscreen, fullscreen); + if (EQ (old_value, Qfullboth) && EQ (fullscreen, Qnil)) + store_frame_param (f, Qfullscreen, fullscreen); // break here + else + store_frame_param (f, Qfullscreen, fullscreen); + if (!EQ (fullscreen, old_value)) gui_set_fullscreen (f, fullscreen, old_value); } diff --git a/src/xterm.c b/src/xterm.c index fd3e58f85f6..3b5311b0977 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -18041,7 +18041,11 @@ x_net_wm_state (struct frame *f, Window window) break; } - store_frame_param (f, Qfullscreen, lval); + if (EQ (get_frame_param (f, Qfullscreen), Qfullboth) && EQ (lval, Qnil)) + store_frame_param (f, Qfullscreen, lval); // break here + else + store_frame_param (f, Qfullscreen, lval); + store_frame_param (f, Qsticky, sticky ? Qt : Qnil); store_frame_param (f, Qshaded, shaded ? Qt : Qnil); } @@ -28272,7 +28276,11 @@ x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event) break; } - store_frame_param (f, Qfullscreen, lval); + if (EQ (get_frame_param (f, Qfullscreen), Qfullboth) && EQ (lval, Qnil)) + store_frame_param (f, Qfullscreen, lval); // break here + else + store_frame_param (f, Qfullscreen, lval); + store_frame_param (f, Qsticky, sticky ? Qt : Qnil); store_frame_param (f, Qshaded, shaded ? Qt : Qnil); @@ -28340,7 +28348,10 @@ x_check_fullscreen (struct frame *f) /* `x_net_wm_state' might have reset the fullscreen frame parameter, restore it. */ - store_frame_param (f, Qfullscreen, lval); + if (EQ (get_frame_param (f, Qfullscreen), Qfullboth) && EQ (lval, Qnil)) + store_frame_param (f, Qfullscreen, lval); // break here + else + store_frame_param (f, Qfullscreen, lval); } /* This function is called by x_set_offset to determine whether the window