gimp r28224 - in trunk: . app/display app/widgets



Author: mitch
Date: Sat Mar 28 13:19:53 2009
New Revision: 28224
URL: http://svn.gnome.org/viewvc/gimp?rev=28224&view=rev

Log:
2009-03-28  Michael Natterer  <mitch gimp org>

	Bug 555025 â Action GEGL box widgets weirdness

	Must not set GDK_HINT_MIN_SIZE if we don't actually set a minimum
	size, or the window will be shrinkable to zero and it won't
	expand automatically when its contents' requisition grows.

	* app/widgets/gimpdialogfactory.[ch]: add hackish API
	gimp_dialog_factory_set,get_has_min_size() because GTK+ itself
	has no API for querying a window's GdkWindowHints.

	(gimp_dialog_factory_set_user_pos): set GDK_HINT_MIN_SIZE only if
	the window was being marked as having a minimum size using above
	new API.

	* app/widgets/gimptoolbox.c (gimp_toolbox_set_geometry)
	* app/display/gimpdisplayshell.c (gimp_display_shell_style_set):
	call gimp_dialog_factory_set_has_min_size (window, TRUE).



Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell.c
   trunk/app/widgets/gimpdialogfactory.c
   trunk/app/widgets/gimpdialogfactory.h
   trunk/app/widgets/gimptoolbox.c

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Sat Mar 28 13:19:53 2009
@@ -740,6 +740,8 @@
 
   gtk_window_set_geometry_hints (GTK_WINDOW (widget), NULL,
                                  &geometry, geometry_mask);
+
+  gimp_dialog_factory_set_has_min_size (GTK_WINDOW (widget), TRUE);
 }
 
 static void

Modified: trunk/app/widgets/gimpdialogfactory.c
==============================================================================
--- trunk/app/widgets/gimpdialogfactory.c	(original)
+++ trunk/app/widgets/gimpdialogfactory.c	Sat Mar 28 13:19:53 2009
@@ -1234,6 +1234,27 @@
   return g_object_get_qdata (G_OBJECT (dialog), gimp_dialog_factory_key);
 }
 
+#define GIMP_DIALOG_FACTORY_MIN_SIZE_KEY "gimp-dialog-factory-min-size"
+
+void
+gimp_dialog_factory_set_has_min_size (GtkWindow *window,
+                                      gboolean   has_min_size)
+{
+  g_return_if_fail (GTK_IS_WINDOW (window));
+
+  g_object_set_data (G_OBJECT (window), GIMP_DIALOG_FACTORY_MIN_SIZE_KEY,
+                     GINT_TO_POINTER (has_min_size ? TRUE : FALSE));
+}
+
+gboolean
+gimp_dialog_factory_get_has_min_size (GtkWindow *window)
+{
+  g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+  return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window),
+                                             GIMP_DIALOG_FACTORY_MIN_SIZE_KEY));
+}
+
 
 /*  private functions  */
 
@@ -1287,6 +1308,7 @@
                                   GdkEventConfigure *cevent,
                                   gpointer           data)
 {
+  GdkWindowHints          geometry_mask;
 #ifdef DEBUG_FACTORY
   GimpDialogFactoryEntry *entry;
 
@@ -1301,9 +1323,13 @@
                                         gimp_dialog_factory_set_user_pos,
                                         data);
 
+  geometry_mask = GDK_HINT_USER_POS;
+
+  if (gimp_dialog_factory_get_has_min_size (GTK_WINDOW (dialog)))
+    geometry_mask |= GDK_HINT_MIN_SIZE;
+
   gtk_window_set_geometry_hints (GTK_WINDOW (dialog), NULL, NULL,
-                                 GDK_HINT_MIN_SIZE |
-                                 GDK_HINT_USER_POS);
+                                 geometry_mask);
 
   return FALSE;
 }

Modified: trunk/app/widgets/gimpdialogfactory.h
==============================================================================
--- trunk/app/widgets/gimpdialogfactory.h	(original)
+++ trunk/app/widgets/gimpdialogfactory.h	Sat Mar 28 13:19:53 2009
@@ -178,5 +178,9 @@
             gimp_dialog_factory_from_widget (GtkWidget               *dialog,
                                              GimpDialogFactoryEntry **entry);
 
+void        gimp_dialog_factory_set_has_min_size    (GtkWindow       *window,
+                                                     gboolean         has_min_size);
+gboolean    gimp_dialog_factory_get_has_min_size    (GtkWindow       *window);
+
 
 #endif  /*  __GIMP_DIALOG_FACTORY_H__  */

Modified: trunk/app/widgets/gimptoolbox.c
==============================================================================
--- trunk/app/widgets/gimptoolbox.c	(original)
+++ trunk/app/widgets/gimptoolbox.c	Sat Mar 28 13:19:53 2009
@@ -613,6 +613,8 @@
                                      GDK_HINT_MIN_SIZE   |
                                      GDK_HINT_RESIZE_INC |
                                      GDK_HINT_USER_POS);
+
+      gimp_dialog_factory_set_has_min_size (GTK_WINDOW (toolbox), TRUE);
     }
 }
 



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