Commit d9448730 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

Bug 555025 – Action GEGL box widgets weirdness

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).


svn path=/trunk/; revision=28224
parent e148dfd6
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).
2009-03-27 Sven Neumann <sven@gimp.org>
Bug 576909 "_Paste" and "_Paste as" have the same mnemonic
......
......@@ -740,6 +740,8 @@ gimp_display_shell_style_set (GtkWidget *widget,
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
......
......@@ -1234,6 +1234,27 @@ gimp_dialog_factory_from_widget (GtkWidget *dialog,
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 @@ gimp_dialog_factory_set_user_pos (GtkWidget *dialog,
GdkEventConfigure *cevent,
gpointer data)
{
GdkWindowHints geometry_mask;
#ifdef DEBUG_FACTORY
GimpDialogFactoryEntry *entry;
......@@ -1301,9 +1323,13 @@ gimp_dialog_factory_set_user_pos (GtkWidget *dialog,
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;
}
......
......@@ -178,5 +178,9 @@ GimpDialogFactory *
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__ */
......@@ -613,6 +613,8 @@ gimp_toolbox_set_geometry (GimpToolbox *toolbox)
GDK_HINT_MIN_SIZE |
GDK_HINT_RESIZE_INC |
GDK_HINT_USER_POS);
gimp_dialog_factory_set_has_min_size (GTK_WINDOW (toolbox), TRUE);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment