aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2021-07-03 15:48:40 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-24 11:41:24 -0600
commita95338ca43c7b979ef81fb9d6b0c561beda93be2 (patch)
tree83138255cb18e80a6f73515ae34905fd83ccf3fe /dwl.c
parentae614ee5125891a4d75fac97c754207f97834a7d (diff)
implement input-inhibitor protocol
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index 01d165b..1bee09c 100644
--- a/dwl.c
+++ b/dwl.c
@@ -22,6 +22,7 @@
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_input_device.h>
+#include <wlr/types/wlr_input_inhibitor.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h>
@@ -311,6 +312,7 @@ static struct wl_list clients; /* tiling order */
static struct wl_list fstack; /* focus order */
static struct wlr_idle *idle;
static struct wlr_idle_inhibit_manager_v1 *idle_inhibit_mgr;
+static struct wlr_input_inhibit_manager *input_inhibit_mgr;
static struct wlr_layer_shell_v1 *layer_shell;
static struct wlr_output_manager_v1 *output_mgr;
static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr;
@@ -1309,8 +1311,10 @@ keypress(struct wl_listener *listener, void *data)
wlr_idle_notify_activity(idle, seat);
- /* On _press_, attempt to process a compositor keybinding. */
- if (event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
+ /* On _press_ if there is no active screen locker,
+ * attempt to process a compositor keybinding. */
+ if (!input_inhibit_mgr->active_inhibitor
+ && event->state == WL_KEYBOARD_KEY_STATE_PRESSED)
for (i = 0; i < nsyms; i++)
handled = keybinding(mods, syms[i]) || handled;
@@ -1996,6 +2000,8 @@ setup(void)
xdg_shell = wlr_xdg_shell_create(dpy);
wl_signal_add(&xdg_shell->events.new_surface, &new_xdg_surface);
+ input_inhibit_mgr = wlr_input_inhibit_manager_create(dpy);
+
/* Use decoration protocols to negotiate server-side decorations */
wlr_server_decoration_manager_set_default_mode(
wlr_server_decoration_manager_create(dpy),