gimp r25221 - in trunk: . app/display



Author: neo
Date: Tue Mar 25 13:12:36 2008
New Revision: 25221
URL: http://svn.gnome.org/viewvc/gimp?rev=25221&view=rev

Log:
2008-03-25  Sven Neumann  <sven gimp org>

	* app/display/gimpdisplayshell-callbacks.[ch]: 
	* app/display/gimpdisplayshell.c (gimp_display_shell_init): moved
	handling of window state events to a separate callback.


Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell-callbacks.c
   trunk/app/display/gimpdisplayshell-callbacks.h
   trunk/app/display/gimpdisplayshell.c

Modified: trunk/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.c	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.c	Tue Mar 25 13:12:36 2008
@@ -212,44 +212,47 @@
       }
       break;
 
-    case GDK_WINDOW_STATE:
-      {
-        GdkEventWindowState *sevent = (GdkEventWindowState *) event;
-        gboolean             fullscreen;
-        GimpActionGroup     *group;
+    default:
+      break;
+    }
 
-        shell->window_state = sevent->new_window_state;
+  /*  Setting the context's display automatically sets the image, too  */
+  if (set_display)
+    gimp_context_set_display (gimp_get_user_context (gimp), shell->display);
 
-        if (! (sevent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
-          break;
+  return FALSE;
+}
 
-        fullscreen = gimp_display_shell_get_fullscreen (shell);
+gboolean
+gimp_display_shell_window_state_event (GtkWidget           *widget,
+                                       GdkEventWindowState *event,
+                                       GimpDisplayShell    *shell)
+{
+  shell->window_state = event->new_window_state;
 
-        gimp_display_shell_appearance_update (shell);
+  if (event->changed_mask & GDK_WINDOW_STATE_FULLSCREEN)
+    {
+      Gimp            *gimp = shell->display->gimp;
+      GimpActionGroup *group;
+      gboolean         fullscreen;
 
-        group = gimp_ui_manager_get_action_group (shell->menubar_manager,
-                                                  "view");
-        gimp_action_group_set_action_active (group, "view-fullscreen",
-                                             fullscreen);
+      gimp_display_shell_appearance_update (shell);
 
-        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);
-          }
-      }
-      break;
+      fullscreen = gimp_display_shell_get_fullscreen (shell);
 
-    default:
-      break;
-    }
+      group = gimp_ui_manager_get_action_group (shell->menubar_manager, "view");
+      gimp_action_group_set_action_active (group,
+                                           "view-fullscreen", fullscreen);
 
-  /*  Setting the context's display automatically sets the image, too  */
-  if (set_display)
-    gimp_context_set_display (gimp_get_user_context (gimp), shell->display);
+      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);
+        }
+    }
 
   return FALSE;
 }

Modified: trunk/app/display/gimpdisplayshell-callbacks.h
==============================================================================
--- trunk/app/display/gimpdisplayshell-callbacks.h	(original)
+++ trunk/app/display/gimpdisplayshell-callbacks.h	Tue Mar 25 13:12:36 2008
@@ -34,9 +34,12 @@
                                               GDK_PROXIMITY_OUT_MASK)
 
 
-gboolean   gimp_display_shell_events                  (GtkWidget        *widget,
-                                                       GdkEvent         *event,
-                                                       GimpDisplayShell *shell);
+gboolean   gimp_display_shell_events               (GtkWidget           *widget,
+                                                    GdkEvent            *event,
+                                                    GimpDisplayShell    *shell);
+gboolean   gimp_display_shell_window_state_event   (GtkWidget           *widget,
+                                                    GdkEventWindowState *event,
+                                                    GimpDisplayShell    *shell);
 
 void       gimp_display_shell_canvas_realize          (GtkWidget        *widget,
                                                        GimpDisplayShell *shell);

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Tue Mar 25 13:12:36 2008
@@ -365,8 +365,9 @@
   g_signal_connect (shell, "key-press-event",
                     G_CALLBACK (gimp_display_shell_events),
                     shell);
+
   g_signal_connect (shell, "window-state-event",
-                    G_CALLBACK (gimp_display_shell_events),
+                    G_CALLBACK (gimp_display_shell_window_state_event),
                     shell);
 
   gimp_help_connect (GTK_WIDGET (shell), gimp_standard_help_func,



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