gimp r25419 - in branches/weskaggs: . app/display app/tools



Author: weskaggs
Date: Tue Apr  8 21:50:46 2008
New Revision: 25419
URL: http://svn.gnome.org/viewvc/gimp?rev=25419&view=rev

Log:
Bill Skaggs  <weskaggs primate ucdavis edu>

	* app/tools/gimptexttool.c
	* app/display/gimpdisplayshell.c
	* app/display/gimpdisplayshell-callbacks.[ch]: fix some
	bugs arising from making display shell a non-toplevel.


Modified:
   branches/weskaggs/ChangeLog
   branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
   branches/weskaggs/app/display/gimpdisplayshell-callbacks.h
   branches/weskaggs/app/display/gimpdisplayshell.c
   branches/weskaggs/app/tools/gimptexttool.c

Modified: branches/weskaggs/app/display/gimpdisplayshell-callbacks.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-callbacks.c	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell-callbacks.c	Tue Apr  8 21:50:46 2008
@@ -100,6 +100,86 @@
 /*  public functions  */
 
 gboolean
+gimp_display_shell_container_events (GtkWidget        *widget,
+                                     GdkEvent         *event,
+                                     GimpDisplayShell *shell)
+{
+  Gimp     *gimp;
+
+  /*  are we in destruction?  */
+  if (! shell->display || ! shell->display->shell)
+    return TRUE;
+
+  gimp = shell->display->image->gimp;
+
+  switch (event->type)
+    {
+    case GDK_WINDOW_STATE:
+      {
+        GdkEventWindowState *sevent = (GdkEventWindowState *) event;
+        GimpDisplayOptions  *options;
+        gboolean             fullscreen;
+        GimpActionGroup     *group;
+
+        shell->window_state = sevent->new_window_state;
+
+        if (! (sevent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
+          break;
+
+        fullscreen = gimp_display_shell_get_fullscreen (shell);
+
+        gtk_widget_set_name (GTK_WIDGET (shell->menubar),
+                             fullscreen ? "gimp-menubar-fullscreen" : NULL);
+
+        options = fullscreen ? shell->fullscreen_options : shell->options;
+
+        gimp_display_shell_set_show_menubar       (shell,
+                                                   options->show_menubar);
+        gimp_display_shell_set_show_rulers        (shell,
+                                                   options->show_rulers);
+        gimp_display_shell_set_show_scrollbars    (shell,
+                                                   options->show_scrollbars);
+        gimp_display_shell_set_show_statusbar     (shell,
+                                                   options->show_statusbar);
+        gimp_display_shell_set_show_selection     (shell,
+                                                   options->show_selection);
+        gimp_display_shell_set_show_layer         (shell,
+                                                   options->show_layer_boundary);
+        gimp_display_shell_set_show_guides        (shell,
+                                                   options->show_guides);
+        gimp_display_shell_set_show_grid          (shell,
+                                                   options->show_grid);
+        gimp_display_shell_set_show_sample_points (shell,
+                                                   options->show_sample_points);
+        gimp_display_shell_set_padding            (shell,
+                                                   options->padding_mode,
+                                                   &options->padding_color);
+
+        group = gimp_ui_manager_get_action_group (shell->menubar_manager,
+                                                  "view");
+        gimp_action_group_set_action_active (group, "view-fullscreen",
+                                             fullscreen);
+
+        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;
+
+    default:
+      break;
+    }
+
+  return FALSE;
+}
+
+
+gboolean
 gimp_display_shell_events (GtkWidget        *widget,
                            GdkEvent         *event,
                            GimpDisplayShell *shell)
@@ -207,63 +287,6 @@
       }
       break;
 
-    case GDK_WINDOW_STATE:
-      {
-        GdkEventWindowState *sevent = (GdkEventWindowState *) event;
-        GimpDisplayOptions  *options;
-        gboolean             fullscreen;
-        GimpActionGroup     *group;
-
-        shell->window_state = sevent->new_window_state;
-
-        if (! (sevent->changed_mask & GDK_WINDOW_STATE_FULLSCREEN))
-          break;
-
-        fullscreen = gimp_display_shell_get_fullscreen (shell);
-
-        gtk_widget_set_name (GTK_WIDGET (shell->menubar),
-                             fullscreen ? "gimp-menubar-fullscreen" : NULL);
-
-        options = fullscreen ? shell->fullscreen_options : shell->options;
-
-        gimp_display_shell_set_show_menubar       (shell,
-                                                   options->show_menubar);
-        gimp_display_shell_set_show_rulers        (shell,
-                                                   options->show_rulers);
-        gimp_display_shell_set_show_scrollbars    (shell,
-                                                   options->show_scrollbars);
-        gimp_display_shell_set_show_statusbar     (shell,
-                                                   options->show_statusbar);
-        gimp_display_shell_set_show_selection     (shell,
-                                                   options->show_selection);
-        gimp_display_shell_set_show_layer         (shell,
-                                                   options->show_layer_boundary);
-        gimp_display_shell_set_show_guides        (shell,
-                                                   options->show_guides);
-        gimp_display_shell_set_show_grid          (shell,
-                                                   options->show_grid);
-        gimp_display_shell_set_show_sample_points (shell,
-                                                   options->show_sample_points);
-        gimp_display_shell_set_padding            (shell,
-                                                   options->padding_mode,
-                                                   &options->padding_color);
-
-        group = gimp_ui_manager_get_action_group (shell->menubar_manager,
-                                                  "view");
-        gimp_action_group_set_action_active (group, "view-fullscreen",
-                                             fullscreen);
-
-        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;
-
     default:
       break;
     }

Modified: branches/weskaggs/app/display/gimpdisplayshell-callbacks.h
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell-callbacks.h	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell-callbacks.h	Tue Apr  8 21:50:46 2008
@@ -38,6 +38,10 @@
                                                        GdkEvent         *event,
                                                        GimpDisplayShell *shell);
 
+gboolean   gimp_display_shell_container_events        (GtkWidget        *widget,
+                                                       GdkEvent         *event,
+                                                       GimpDisplayShell *shell);
+
 void       gimp_display_shell_canvas_realize          (GtkWidget        *widget,
                                                        GimpDisplayShell *shell);
 void       gimp_display_shell_canvas_size_allocate    (GtkWidget        *widget,

Modified: branches/weskaggs/app/display/gimpdisplayshell.c
==============================================================================
--- branches/weskaggs/app/display/gimpdisplayshell.c	(original)
+++ branches/weskaggs/app/display/gimpdisplayshell.c	Tue Apr  8 21:50:46 2008
@@ -363,9 +363,6 @@
   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),
-                    shell);
 
   gimp_display_shell_dnd_init (shell);
 
@@ -1118,6 +1115,9 @@
   g_signal_connect (shell->container_window, "delete-event",
                     G_CALLBACK (gimp_display_shell_container_window_closed),
                     shell);
+  g_signal_connect (shell->container_window, "window-state-event",
+                    G_CALLBACK (gimp_display_shell_container_events),
+                    shell);
 
   filter = gimp_display_shell_filter_new (shell,
                                           gimp->config->color_management);

Modified: branches/weskaggs/app/tools/gimptexttool.c
==============================================================================
--- branches/weskaggs/app/tools/gimptexttool.c	(original)
+++ branches/weskaggs/app/tools/gimptexttool.c	Tue Apr  8 21:50:46 2008
@@ -56,6 +56,7 @@
 #include "widgets/gimpviewabledialog.h"
 
 #include "display/gimpdisplay.h"
+#include "display/gimpdisplayshell.h"
 
 #include "gimpeditselectiontool.h"
 #include "gimptextoptions.h"
@@ -736,6 +737,7 @@
   GimpTextOptions   *options = GIMP_TEXT_TOOL_GET_OPTIONS (text_tool);
   GimpDialogFactory *dialog_factory;
   GtkWindow         *parent  = NULL;
+  GimpDisplay       *display = GIMP_TOOL (text_tool)->display;
 
   if (text_tool->editor)
     {
@@ -745,8 +747,8 @@
 
   dialog_factory = gimp_dialog_factory_from_name ("toplevel");
 
-  if (GIMP_TOOL (text_tool)->display)
-    parent = GTK_WINDOW (GIMP_TOOL (text_tool)->display->shell);
+  if (display)
+    parent = GIMP_DISPLAY_SHELL (display->shell)->container_window;
 
   text_tool->editor = gimp_text_options_editor_new (parent, options,
                                                     dialog_factory->menu_factory,



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