[gimp] Move updating the "view-fullscreen" actions to the proper place



commit 4f60240a04a0cff6ebb0d6aaebc0f2f60b8e1f29
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 25 14:06:14 2009 +0200

    Move updating the "view-fullscreen" actions to the proper place
    
    Update the actions in gimp_display_shell_appearance_update() and remove
    all action code from the window-state-event handlers.

 app/display/gimpdisplayshell-appearance.c |    9 ++++++++-
 app/display/gimpdisplayshell.c            |   21 ---------------------
 app/display/gimpimagewindow.c             |    9 +--------
 3 files changed, 9 insertions(+), 30 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c
index 9f2c4d0..76da1c1 100644
--- a/app/display/gimpdisplayshell-appearance.c
+++ b/app/display/gimpdisplayshell-appearance.c
@@ -65,10 +65,17 @@ void
 gimp_display_shell_appearance_update (GimpDisplayShell *shell)
 {
   GimpDisplayOptions *options;
+  GtkWidget          *toplevel;
+  GimpImageWindow    *window;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
 
-  options = appearance_get_options (shell);
+  options  = appearance_get_options (shell);
+  toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));
+  window   = GIMP_IMAGE_WINDOW (toplevel);
+
+  appearance_set_action_active (shell, "view-fullscreen",
+                                gimp_image_window_get_fullscreen (window));
 
   gimp_display_shell_set_show_menubar       (shell,
                                              options->show_menubar);
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 8d935cd..5b8c208 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -661,30 +661,9 @@ gimp_display_shell_window_state_event (GtkWidget           *widget,
                                        GdkEventWindowState *event)
 {
   GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget);
-  Gimp             *gimp  = shell->display->gimp;
 
   GTK_WIDGET_CLASS (parent_class)->window_state_event (widget, event);
 
-  if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
-    {
-      GtkWidget       *window;
-      GimpActionGroup *group;
-      gboolean         fullscreen;
-
-      window = gtk_widget_get_toplevel (widget);
-
-      fullscreen = gimp_image_window_get_fullscreen (GIMP_IMAGE_WINDOW (window));
-
-      if (shell->display ==
-          gimp_context_get_display (gimp_get_user_context (gimp)))
-        {
-          group = gimp_ui_manager_get_action_group (shell->popup_manager,
-                                                    "view");
-          gimp_action_group_set_action_active (group,
-                                               "view-fullscreen", fullscreen);
-        }
-    }
-
   if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
     {
       gimp_display_shell_progress_window_state_changed (shell);
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 9836328..e3ec6d6 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -350,10 +350,7 @@ gimp_image_window_window_state_event (GtkWidget           *widget,
 
   if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
     {
-      GimpActionGroup *group;
-      gboolean         fullscreen;
-
-      fullscreen = gimp_image_window_get_fullscreen (window);
+      gboolean fullscreen = gimp_image_window_get_fullscreen (window);
 
       GIMP_LOG (WM, "Image window '%s' [%p] set fullscreen %s",
                 gtk_window_get_title (GTK_WINDOW (widget)),
@@ -368,10 +365,6 @@ gimp_image_window_window_state_event (GtkWidget           *widget,
                                          ! fullscreen);
 
       gimp_display_shell_appearance_update (GIMP_DISPLAY_SHELL (display->shell));
-
-      group = gimp_ui_manager_get_action_group (window->menubar_manager, "view");
-      gimp_action_group_set_action_active (group,
-                                           "view-fullscreen", fullscreen);
     }
 
   if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]