[gtk+/resizegrips] Emit notify::resize-grip-visible when needed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/resizegrips] Emit notify::resize-grip-visible when needed
- Date: Sun, 3 Oct 2010 06:03:17 +0000 (UTC)
commit 8022ee3e5913a86de3b6adc0d7e3571cb7d20d16
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 3 02:01:06 2010 -0400
Emit notify::resize-grip-visible when needed
gtk/gtkwindow.c | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f4d807a..99e0342 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1204,6 +1204,7 @@ gtk_window_set_property (GObject *object,
break;
case PROP_HAS_RESIZE_GRIP:
gtk_window_set_has_resize_grip (window, g_value_get_boolean (value));
+ break;
case PROP_MNEMONICS_VISIBLE:
gtk_window_set_mnemonics_visible (window, g_value_get_boolean (value));
break;
@@ -5279,6 +5280,7 @@ resize_grip_destroy_window (GtkWindow *window)
gdk_window_set_user_data (priv->grip_window, NULL);
gdk_window_destroy (priv->grip_window);
priv->grip_window = NULL;
+ update_grip_visibility (window);
}
void
@@ -5310,16 +5312,22 @@ gtk_window_set_has_resize_grip (GtkWindow *window,
static void
update_grip_visibility (GtkWindow *window)
{
- gboolean val = gtk_window_resize_grip_is_visible (window);
+ GtkWindowPrivate *priv = window->priv;
+ gboolean val;
- if (val)
- gdk_window_show (window->priv->grip_window);
- else
- gdk_window_hide (window->priv->grip_window);
+ val = gtk_window_resize_grip_is_visible (window);
+
+ if (priv->grip_window != NULL)
+ {
+ if (val)
+ gdk_window_show (priv->grip_window);
+ else
+ gdk_window_hide (priv->grip_window);
+ }
- if (window->priv->resize_grip_visible != val)
+ if (priv->resize_grip_visible != val)
{
- window->priv->resize_grip_visible = val;
+ priv->resize_grip_visible = val;
g_object_notify (G_OBJECT (window), "resize-grip-visible");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]