summaryrefslogtreecommitdiff
path: root/src/core/keybindings.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-08-29 12:18:09 -0400
committerVictor Kareh <[email protected]>2026-01-21 16:37:58 -0500
commit8fddd5d9114b4bd6169b7ab8f26acf3025dfa024 (patch)
tree0e013f2ae6f8dcfa86b3a5e93fa0f25be0748639 /src/core/keybindings.c
parent73d8c63ae0ade29e790430240b32133be7551c21 (diff)
downloadmarco-8fddd5d9114b4bd6169b7ab8f26acf3025dfa024.tar.bz2
marco-8fddd5d9114b4bd6169b7ab8f26acf3025dfa024.tar.xz
keybindings: Release keyboard grab on screenshot commands
This prevents race conditions with applications like mate-screenshot that need to grab input (e.g. for area selection). Fixes mate-desktop/mate-utils#37
Diffstat (limited to 'src/core/keybindings.c')
-rw-r--r--src/core/keybindings.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index c74577f9..b1b1780a 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -2510,6 +2510,15 @@ handle_run_command (MetaDisplay *display,
return;
}
+ /* Release keyboard grabs immediately for screenshot commands that may need
+ * input grabbing. This prevents race conditions with applications like
+ * mate-screenshot that need to grab input for area selection.
+ */
+ if (which >= SCREENSHOT_COMMAND_IDX && which <= WIN_SCREENSHOT_COMMAND_IDX)
+ {
+ ungrab_keyboard (display, event->xkey.time);
+ }
+
err = NULL;
if (!meta_spawn_command_line_async_on_screen (command, screen, &err))
{