mutter/mutter-wayland-fix-keyboard-move-resize-window.patch
Yifan Jiang 2825abc696 Accepting request 785405 from home:AZhou:branches:GNOME:Factory
- Add mutter-wayland-fix-keyboard-move-resize-window.patch:
  move some common code out of X11 only code blocks to fix it
  (bsc#1159976, glgo#GNOME/mutter!997).

OBS-URL: https://build.opensuse.org/request/show/785405
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/mutter?expand=0&rev=342
2020-03-19 06:44:26 +00:00

37 lines
1.2 KiB
Diff

diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index b86272541..b995075fb 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1820,12 +1820,12 @@ meta_window_grab_all_keys (MetaWindow *window,
meta_topic (META_DEBUG_KEYBINDINGS,
"Grabbing all keys on window %s\n", window->desc);
retval = grab_keyboard (grabwindow, timestamp, XIGrabModeAsync);
- if (retval)
- {
- window->keys_grabbed = FALSE;
- window->all_keys_grabbed = TRUE;
- window->grab_on_frame = window->frame != NULL;
- }
+ }
+ if (retval)
+ {
+ window->keys_grabbed = FALSE;
+ window->all_keys_grabbed = TRUE;
+ window->grab_on_frame = window->frame != NULL;
}
return retval;
@@ -1835,9 +1835,10 @@ void
meta_window_ungrab_all_keys (MetaWindow *window,
guint32 timestamp)
{
- if (!meta_is_wayland_compositor () && window->all_keys_grabbed)
+ if (window->all_keys_grabbed)
{
- ungrab_keyboard (timestamp);
+ if (!meta_is_wayland_compositor())
+ ungrab_keyboard (timestamp);
window->grab_on_frame = FALSE;
window->all_keys_grabbed = FALSE;