summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-03-19 22:51:41 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-03-26 19:18:39 -0400
commitf941a47f646d55ab911829fdd38663b0ff6642d9 (patch)
tree9602106ed3128cfa750a0c2a63aba4b83cdcd04f
parent64ad835cdeece9d9e04c5ce27eef9bd4a862baea (diff)
downloadgtk+-f941a47f646d55ab911829fdd38663b0ff6642d9.tar.gz
popup: Keep surface state in sync
Under Wayland, the surface may 'spontaneously' disappear (when the user clicks elsewhere). In this case, we get a state-changed signal and need to keep the GTK state in sync by hiding the widget.
-rw-r--r--gtk/gtkpopup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk/gtkpopup.c b/gtk/gtkpopup.c
index 6519ffdf03..cdf72c60c1 100644
--- a/gtk/gtkpopup.c
+++ b/gtk/gtkpopup.c
@@ -197,6 +197,12 @@ surface_state_changed (GtkWidget *widget)
if (changed_mask & GDK_SURFACE_STATE_FOCUSED)
ensure_state_flag_backdrop (widget);
+
+ if (changed_mask & GDK_SURFACE_STATE_WITHDRAWN)
+ {
+ if (priv->state & GDK_SURFACE_STATE_WITHDRAWN)
+ gtk_widget_hide (widget);
+ }
}
static void