From 1c188e7c2bfd8f2f735d26336c08559277f90fce Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 12 Mar 2004 20:48:51 +0000 Subject: [PATCH] Create the event_window at the right size using the same logic as in Fri Mar 12 15:06:44 2004 Owen Taylor * 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) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkexpander.c | 14 ++++++++++---- 6 files changed, 40 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d46ec669e..7b2da00649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Mar 12 15:06:44 2004 Owen Taylor + + * 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) + 2004-03-12 Federico Mena Quintero * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 9d46ec669e..7b2da00649 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Fri Mar 12 15:06:44 2004 Owen Taylor + + * 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) + 2004-03-12 Federico Mena Quintero * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 9d46ec669e..7b2da00649 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Fri Mar 12 15:06:44 2004 Owen Taylor + + * 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) + 2004-03-12 Federico Mena Quintero * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 9d46ec669e..7b2da00649 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Fri Mar 12 15:06:44 2004 Owen Taylor + + * 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) + 2004-03-12 Federico Mena Quintero * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 9d46ec669e..7b2da00649 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Fri Mar 12 15:06:44 2004 Owen Taylor + + * 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) + 2004-03-12 Federico Mena Quintero * gtk/gtkwindow.c (gtk_window_activate_focus): Don't ignore the 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 |