]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle window state changes on PGTK
authorPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 00:58:23 +0000 (08:58 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 6 Feb 2022 00:58:23 +0000 (08:58 +0800)
* src/pgtkterm.c (window_state_event): Set fullscreen, sticky,
and iconification status according to the new window state.
(bug#53793)

src/pgtkterm.c

index d0a2980bc1b732f8d2e8b99cefe8e69c32adbf7d..23ad3c318c20bb6ddbcb3fd09774296a31db54f9 100644 (file)
@@ -5694,6 +5694,32 @@ window_state_event (GtkWidget *widget,
        }
     }
 
+  if (event->window_state.new_window_state
+      & GDK_WINDOW_STATE_FULLSCREEN)
+    store_frame_param (f, Qfullscreen, Qfullboth);
+  else if (event->window_state.new_window_state
+          & GDK_WINDOW_STATE_MAXIMIZED)
+    store_frame_param (f, Qfullscreen, Qmaximized);
+  else
+    store_frame_param (f, Qfullscreen, Qnil);
+
+  if (event->window_state.new_window_state
+      & GDK_WINDOW_STATE_ICONIFIED)
+    SET_FRAME_ICONIFIED (f, true);
+  else
+    {
+      FRAME_X_OUTPUT (f)->has_been_visible = true;
+      inev.ie.kind = DEICONIFY_EVENT;
+      XSETFRAME (inev.ie.frame_or_window, f);
+      SET_FRAME_ICONIFIED (f, false);
+    }
+
+  if (event->window_state.new_window_state
+      & GDK_WINDOW_STATE_STICKY)
+    store_frame_param (f, Qsticky, Qt);
+  else
+    store_frame_param (f, Qsticky, Qnil);
+
   if (inev.ie.kind != NO_EVENT)
     evq_enqueue (&inev);
   return FALSE;