diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-03-12 20:48:51 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-03-12 20:48:51 +0000 |
commit | 1c188e7c2bfd8f2f735d26336c08559277f90fce (patch) | |
tree | 6a4798dfa50efb552dcc5d8d79737fc9d52b3ec0 /gtk/gtkexpander.c | |
parent | edf8e6f58039f1074249f449ab157c6834e3d4f0 (diff) | |
download | gtk+-1c188e7c2bfd8f2f735d26336c08559277f90fce.tar.gz |
Create the event_window at the right size using the same logic as in
Fri Mar 12 15:06:44 2004 Owen Taylor <otaylor@redhat.com>
* gtk/gtkexpander.c (gtk_expander_realize): Create the
event_window at the right size using the same logic as
in size_allocate. (#136994, Niklas Knuttson)
Diffstat (limited to 'gtk/gtkexpander.c')
-rw-r--r-- | gtk/gtkexpander.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index 01a8c8a3b6..eace48f019 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -115,6 +115,9 @@ static void gtk_expander_forall (GtkContainer *container, static void gtk_expander_activate (GtkExpander *expander); +static void get_expander_bounds (GtkExpander *expander, + GdkRectangle *rect); + static GtkBinClass *parent_class = NULL; GType @@ -382,17 +385,20 @@ gtk_expander_realize (GtkWidget *widget) GdkWindowAttr attributes; gint attributes_mask; gint border_width; + GdkRectangle expander_rect; priv = GTK_EXPANDER (widget)->priv; GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); border_width = GTK_CONTAINER (widget)->border_width; - + + get_expander_bounds (GTK_EXPANDER (widget), &expander_rect); + attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x + border_width; - attributes.y = widget->allocation.y + border_width; - attributes.width = widget->allocation.width - 2 * border_width; - attributes.height = widget->allocation.height - 2 * border_width; + attributes.y = expander_rect.y; + attributes.width = MAX (widget->allocation.width - 2 * border_width, 1); + attributes.height = expander_rect.width; attributes.wclass = GDK_INPUT_ONLY; attributes.event_mask = gtk_widget_get_events (widget) | GDK_BUTTON_PRESS_MASK | |