summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boles <dboles.src@gmail.com>2023-04-29 21:58:00 +0100
committerDaniel Boles <dboles.src@gmail.com>2023-04-29 21:58:00 +0100
commit5cc7ce0ef078105a34ccd4488649c8dc9e46e0c8 (patch)
treeec82060294b5f76221cee66e5a122bab3fc8cdb5
parent90472dc481e83b0890aca66e45ea5c165f432a7f (diff)
downloadgtk+-dboles/issue2069.tar.gz
Expander: Fix parent map caused input to collapseddboles/issue2069
…child, because we were not calling update_child_mapped(), so the hidden child still floated in the aether silently waiting to wrongly take input Close https://gitlab.gnome.org/GNOME/gtk/-/issues/2069
-rw-r--r--gtk/gtkexpander.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 8cfbdb3bf6..fa2ee2415e 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -184,8 +184,10 @@ static void gtk_expander_realize (GtkWidget *widget);
static void gtk_expander_unrealize (GtkWidget *widget);
static void gtk_expander_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
+
static void gtk_expander_map (GtkWidget *widget);
static void gtk_expander_unmap (GtkWidget *widget);
+
static gboolean gtk_expander_draw (GtkWidget *widget,
cairo_t *cr);
@@ -204,6 +206,9 @@ static void gtk_expander_drag_leave (GtkWidget *widget,
GdkDragContext *context,
guint time);
+static void gtk_expander_update_child_mapped (GtkExpander *expander,
+ GtkWidget *child);
+
static void gtk_expander_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_expander_remove (GtkContainer *container,
@@ -696,7 +701,8 @@ gtk_expander_size_allocate (GtkWidget *widget,
static void
gtk_expander_map (GtkWidget *widget)
{
- GtkExpanderPrivate *priv = GTK_EXPANDER (widget)->priv;
+ GtkExpander *expander = GTK_EXPANDER (widget);
+ GtkExpanderPrivate *priv = expander->priv;
if (priv->label_widget)
gtk_widget_map (priv->label_widget);
@@ -705,6 +711,8 @@ gtk_expander_map (GtkWidget *widget)
if (priv->event_window)
gdk_window_show (priv->event_window);
+
+ gtk_expander_update_child_mapped (expander, NULL);
}
static void
@@ -1101,6 +1109,9 @@ gtk_expander_update_child_mapped (GtkExpander *expander,
* not, so otherwise the child is not drawn but still consumes input in-place.
*/
+ if (child == NULL)
+ child = gtk_bin_get_child (GTK_BIN (expander));
+
if (expander->priv->expanded &&
gtk_widget_get_realized (child) &&
gtk_widget_get_visible (child))