1
0
Fork 0
mutter-performance-source/src/wayland/meta-wayland-inhibit-shortcuts-dialog.h
Olivier Fourdan 9c16e4e2f3 wayland: Keep the inhibit shortcut dialog
On Wayland, the grab()/ungrab() in gtk+/gdk are wired to the shortcut
inhibitor mechanism, which in turn shows the dialog, which can take
focus away from the client window when the dialog is shown.

If the client issues an ungrab() when the keyboard focus is lost, we
would hide the dialog, causing the keyboard focus to be returned to the
client surface, which in turn would issue a new grab(), so forth and so
on, causing a continuous show/hide of the shortcut inhibitor dialog.

To avoid this issue, keep the dialog around even if the shortcut inhibit
is canceled by the client, so that the user is forced to make a choice
that we can reuse on the next request without showing the dialog again.

Instead of hiding the dialog when the shortcut inhibitor is destroyed by
the client, we simply mark the request as canceled and do not apply the
user's choice.

https://bugzilla.gnome.org/show_bug.cgi?id=787568
2017-09-14 09:32:26 +02:00

31 lines
1.2 KiB
C

/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef META_WAYLAND_INHIBIT_SHORTCUTS_DIALOG_H
#define META_WAYLAND_INHIBIT_SHORTCUTS_DIALOG_H
#include "meta-wayland-private.h"
void meta_wayland_surface_show_inhibit_shortcuts_dialog (MetaWaylandSurface *surface,
MetaWaylandSeat *seat);
void meta_wayland_surface_cancel_inhibit_shortcuts_dialog (MetaWaylandSurface *surface);
void meta_wayland_surface_inhibit_shortcuts_dialog_init (void);
#endif /* META_WAYLAND_INHIBIT_SHORTCUTS_DIALOG_H */