[mutter] wayland/inhibit-shortcuts-dialog: Only reuse last reply if there was one



commit a7915ff8aedf6662077f85e6918d05546c2fb648
Author: Jonas Ådahl <jadahl gmail com>
Date:   Sat Aug 19 00:06:22 2017 +0800

    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

 .../meta-wayland-inhibit-shortcuts-dialog.c        |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c 
b/src/wayland/meta-wayland-inhibit-shortcuts-dialog.c
index 6eb2208..207c6b1 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]