diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-19 22:51:41 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-26 19:18:39 -0400 |
commit | f941a47f646d55ab911829fdd38663b0ff6642d9 (patch) | |
tree | 9602106ed3128cfa750a0c2a63aba4b83cdcd04f | |
parent | 64ad835cdeece9d9e04c5ce27eef9bd4a862baea (diff) | |
download | gtk+-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.c | 6 |
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 |