From a7915ff8aedf6662077f85e6918d05546c2fb648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 19 Aug 2017 00:06:22 +0800 Subject: [PATCH] wayland/inhibit-shortcuts-dialog: Only reuse last reply if there was one We might have hidden the dialog, without a response. To avoid using the not answered response, make sure we have actually got one before reusing. https://bugzilla.gnome.org/show_bug.cgi?id=786385 --- src/wayland/meta-wayland-inhibit-shortcuts-dialog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c b/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c index 6eb2208e7..207c6b1c7 100644 --- a/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c +++ b/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c @@ -30,6 +30,7 @@ typedef struct _InhibitShortcutsData MetaWaylandSurface *surface; MetaWaylandSeat *seat; MetaInhibitShortcutsDialog *dialog; + gboolean has_last_response; MetaInhibitShortcutsDialogResponse last_response; } InhibitShortcutsData; @@ -82,6 +83,7 @@ inhibit_shortcuts_dialog_response_cb (MetaInhibitShortcutsDialog *dialog, InhibitShortcutsData *data) { data->last_response = response; + data->has_last_response = TRUE; inhibit_shortcuts_dialog_response_apply (data); meta_wayland_surface_hide_inhibit_shortcuts_dialog (data->surface); } @@ -136,7 +138,7 @@ meta_wayland_surface_show_inhibit_shortcuts_dialog (MetaWaylandSurface *surface, g_return_if_fail (META_IS_WAYLAND_SURFACE (surface)); data = surface_inhibit_shortcuts_data_get (surface); - if (data != NULL) + if (data && data->has_last_response) { /* The dialog was shown before for this surface but is not showing * anymore, reuse the last user response.