[Xfce4-commits] r30138 - terminal/trunk/terminal

Nick Schermer nick at xfce.org
Thu Jul 2 19:26:59 CEST 2009


Author: nick
Date: 2009-07-02 17:26:59 +0000 (Thu, 02 Jul 2009)
New Revision: 30138

Modified:
   terminal/trunk/terminal/terminal-window.c
Log:
Update fullscreen action if changed by the windowmanager (bug #5155).


Modified: terminal/trunk/terminal/terminal-window.c
===================================================================
--- terminal/trunk/terminal/terminal-window.c	2009-07-02 17:12:57 UTC (rev 30137)
+++ terminal/trunk/terminal/terminal-window.c	2009-07-02 17:26:59 UTC (rev 30138)
@@ -96,6 +96,8 @@
 static void            terminal_window_update_mnemonics              (TerminalWindow         *window);
 static void            terminal_window_rebuild_gomenu                (TerminalWindow         *window);
 static gboolean        terminal_window_delete_event                  (TerminalWindow         *window);
+static void            terminal_window_state_event                   (TerminalWindow         *window,
+                                                                      GdkEventWindowState    *event);
 static void            terminal_window_notebook_page_switched        (GtkNotebook            *notebook,
                                                                       GtkNotebookPage        *page,
                                                                       guint                   page_num,
@@ -408,6 +410,7 @@
   g_object_connect (G_OBJECT (window),
                     "signal::delete-event", G_CALLBACK (terminal_window_delete_event), NULL,
                     "signal-after::style-set", G_CALLBACK (terminal_window_queue_reset_size), NULL,
+                    "signal::window-state-event", G_CALLBACK (terminal_window_state_event), NULL,
                     NULL);
 
   /* set a unique role on each window (for session management) */
@@ -828,6 +831,27 @@
 
 
 static void
+terminal_window_state_event (TerminalWindow      *window,
+                             GdkEventWindowState *event)
+{
+  GtkAction *action;
+  gboolean   fullscreen;
+
+  terminal_return_if_fail (TERMINAL_IS_WINDOW (window));
+
+  /* update the fullscreen action if the fullscreen state changed by the wm */
+  if ((event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) != 0)
+    {
+      fullscreen = (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
+      action = gtk_action_group_get_action (window->action_group, "fullscreen");
+      if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) != fullscreen)
+        gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), fullscreen);
+    }
+}
+
+
+
+static void
 terminal_window_notebook_page_switched (GtkNotebook     *notebook,
                                         GtkNotebookPage *page,
                                         guint            page_num,




More information about the Xfce4-commits mailing list