mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
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
This commit is contained in:
parent
420a712ad5
commit
a7915ff8ae
@ -30,6 +30,7 @@ typedef struct _InhibitShortcutsData
|
|||||||
MetaWaylandSurface *surface;
|
MetaWaylandSurface *surface;
|
||||||
MetaWaylandSeat *seat;
|
MetaWaylandSeat *seat;
|
||||||
MetaInhibitShortcutsDialog *dialog;
|
MetaInhibitShortcutsDialog *dialog;
|
||||||
|
gboolean has_last_response;
|
||||||
MetaInhibitShortcutsDialogResponse last_response;
|
MetaInhibitShortcutsDialogResponse last_response;
|
||||||
} InhibitShortcutsData;
|
} InhibitShortcutsData;
|
||||||
|
|
||||||
@ -82,6 +83,7 @@ inhibit_shortcuts_dialog_response_cb (MetaInhibitShortcutsDialog *dialog,
|
|||||||
InhibitShortcutsData *data)
|
InhibitShortcutsData *data)
|
||||||
{
|
{
|
||||||
data->last_response = response;
|
data->last_response = response;
|
||||||
|
data->has_last_response = TRUE;
|
||||||
inhibit_shortcuts_dialog_response_apply (data);
|
inhibit_shortcuts_dialog_response_apply (data);
|
||||||
meta_wayland_surface_hide_inhibit_shortcuts_dialog (data->surface);
|
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));
|
g_return_if_fail (META_IS_WAYLAND_SURFACE (surface));
|
||||||
|
|
||||||
data = surface_inhibit_shortcuts_data_get (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
|
/* The dialog was shown before for this surface but is not showing
|
||||||
* anymore, reuse the last user response.
|
* anymore, reuse the last user response.
|
||||||
|
Loading…
Reference in New Issue
Block a user