aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar llyyr <llyyr.public@gmail.com>2023-11-22 00:05:03 +0530
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2023-11-22 00:42:55 +0300
commita946b1aecfa3f32a3bfae66d66df0bdf77440d69 (patch)
tree08a09b61e0ae2ab7de4197f9961c998b0aa69fc6
parentmeson: bump wlroots version after 0.17.0 release (diff)
downloadsway-a946b1aecfa3f32a3bfae66d66df0bdf77440d69.tar.gz
sway-a946b1aecfa3f32a3bfae66d66df0bdf77440d69.tar.zst
sway-a946b1aecfa3f32a3bfae66d66df0bdf77440d69.zip
Chase wlroots!4440
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4440
-rw-r--r--include/sway/input/input-manager.h2
-rw-r--r--protocols/meson.build1
-rw-r--r--protocols/wlr-input-inhibitor-unstable-v1.xml67
-rw-r--r--sway/input/input-manager.c37
-rw-r--r--sway/server.c1
5 files changed, 0 insertions, 108 deletions
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h
index 4bd51709..145edd4b 100644
--- a/include/sway/input/input-manager.h
+++ b/include/sway/input/input-manager.h
@@ -1,7 +1,6 @@
1#ifndef _SWAY_INPUT_INPUT_MANAGER_H 1#ifndef _SWAY_INPUT_INPUT_MANAGER_H
2#define _SWAY_INPUT_INPUT_MANAGER_H 2#define _SWAY_INPUT_INPUT_MANAGER_H
3#include <libinput.h> 3#include <libinput.h>
4#include <wlr/types/wlr_input_inhibitor.h>
5#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> 4#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
6#include <wlr/types/wlr_virtual_keyboard_v1.h> 5#include <wlr/types/wlr_virtual_keyboard_v1.h>
7#include <wlr/types/wlr_virtual_pointer_v1.h> 6#include <wlr/types/wlr_virtual_pointer_v1.h>
@@ -21,7 +20,6 @@ struct sway_input_manager {
21 struct wl_list devices; 20 struct wl_list devices;
22 struct wl_list seats; 21 struct wl_list seats;
23 22
24 struct wlr_input_inhibit_manager *inhibit;
25 struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit; 23 struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
26 struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; 24 struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
27 struct wlr_virtual_pointer_manager_v1 *virtual_pointer; 25 struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
diff --git a/protocols/meson.build b/protocols/meson.build
index 2992ac58..81edb584 100644
--- a/protocols/meson.build
+++ b/protocols/meson.build
@@ -16,7 +16,6 @@ protocols = [
16 wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml', 16 wl_protocol_dir / 'staging/cursor-shape/cursor-shape-v1.xml',
17 'wlr-layer-shell-unstable-v1.xml', 17 'wlr-layer-shell-unstable-v1.xml',
18 'idle.xml', 18 'idle.xml',
19 'wlr-input-inhibitor-unstable-v1.xml',
20 'wlr-output-power-management-unstable-v1.xml', 19 'wlr-output-power-management-unstable-v1.xml',
21] 20]
22 21
diff --git a/protocols/wlr-input-inhibitor-unstable-v1.xml b/protocols/wlr-input-inhibitor-unstable-v1.xml
deleted file mode 100644
index b62d1bb4..00000000
--- a/protocols/wlr-input-inhibitor-unstable-v1.xml
+++ /dev/null
@@ -1,67 +0,0 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="wlr_input_inhibit_unstable_v1">
3 <copyright>
4 Copyright © 2018 Drew DeVault
5
6 Permission to use, copy, modify, distribute, and sell this
7 software and its documentation for any purpose is hereby granted
8 without fee, provided that the above copyright notice appear in
9 all copies and that both that copyright notice and this permission
10 notice appear in supporting documentation, and that the name of
11 the copyright holders not be used in advertising or publicity
12 pertaining to distribution of the software without specific,
13 written prior permission. The copyright holders make no
14 representations about the suitability of this software for any
15 purpose. It is provided "as is" without express or implied
16 warranty.
17
18 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
19 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
23 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25 THIS SOFTWARE.
26 </copyright>
27
28 <interface name="zwlr_input_inhibit_manager_v1" version="1">
29 <description summary="inhibits input events to other clients">
30 Clients can use this interface to prevent input events from being sent to
31 any surfaces but its own, which is useful for example in lock screen
32 software. It is assumed that access to this interface will be locked down
33 to whitelisted clients by the compositor.
34 </description>
35
36 <request name="get_inhibitor">
37 <description summary="inhibit input to other clients">
38 Activates the input inhibitor. As long as the inhibitor is active, the
39 compositor will not send input events to other clients.
40 </description>
41 <arg name="id" type="new_id" interface="zwlr_input_inhibitor_v1"/>
42 </request>
43
44 <enum name="error">
45 <entry name="already_inhibited" value="0" summary="an input inhibitor is already in use on the compositor"/>
46 </enum>
47 </interface>
48
49 <interface name="zwlr_input_inhibitor_v1" version="1">
50 <description summary="inhibits input to other clients">
51 While this resource exists, input to clients other than the owner of the
52 inhibitor resource will not receive input events. The client that owns
53 this resource will receive all input events normally. The compositor will
54 also disable all of its own input processing (such as keyboard shortcuts)
55 while the inhibitor is active.
56
57 The compositor may continue to send input events to selected clients,
58 such as an on-screen keyboard (via the input-method protocol).
59 </description>
60
61 <request name="destroy" type="destructor">
62 <description summary="destroy the input inhibitor object">
63 Destroy the inhibitor and allow other clients to receive input.
64 </description>
65 </request>
66 </interface>
67</protocol>
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index dcaeb056..4febc333 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -6,7 +6,6 @@
6#include <wlr/config.h> 6#include <wlr/config.h>
7#include <wlr/types/wlr_cursor.h> 7#include <wlr/types/wlr_cursor.h>
8#include <wlr/types/wlr_keyboard_group.h> 8#include <wlr/types/wlr_keyboard_group.h>
9#include <wlr/types/wlr_input_inhibitor.h>
10#include <wlr/types/wlr_virtual_keyboard_v1.h> 9#include <wlr/types/wlr_virtual_keyboard_v1.h>
11#include <wlr/types/wlr_virtual_pointer_v1.h> 10#include <wlr/types/wlr_virtual_pointer_v1.h>
12#include "sway/config.h" 11#include "sway/config.h"
@@ -284,34 +283,6 @@ static void handle_new_input(struct wl_listener *listener, void *data) {
284 } 283 }
285} 284}
286 285
287static void handle_inhibit_activate(struct wl_listener *listener, void *data) {
288 struct sway_input_manager *input_manager = wl_container_of(
289 listener, input_manager, inhibit_activate);
290 struct sway_seat *seat;
291 wl_list_for_each(seat, &input_manager->seats, link) {
292 seat_set_exclusive_client(seat, input_manager->inhibit->active_client);
293 }
294}
295
296static void handle_inhibit_deactivate(struct wl_listener *listener, void *data) {
297 struct sway_input_manager *input_manager = wl_container_of(
298 listener, input_manager, inhibit_deactivate);
299 struct sway_seat *seat;
300 if (server.session_lock.locked) {
301 // Don't deactivate the grab of a screenlocker
302 return;
303 }
304 wl_list_for_each(seat, &input_manager->seats, link) {
305 seat_set_exclusive_client(seat, NULL);
306 struct sway_node *previous = seat_get_focus(seat);
307 if (previous) {
308 // Hack to get seat to re-focus the return value of get_focus
309 seat_set_focus(seat, NULL);
310 seat_set_focus(seat, previous);
311 }
312 }
313}
314
315static void handle_keyboard_shortcuts_inhibitor_destroy( 286static void handle_keyboard_shortcuts_inhibitor_destroy(
316 struct wl_listener *listener, void *data) { 287 struct wl_listener *listener, void *data) {
317 struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor = 288 struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
@@ -480,14 +451,6 @@ struct sway_input_manager *input_manager_create(struct sway_server *server) {
480 &input->virtual_pointer_new); 451 &input->virtual_pointer_new);
481 input->virtual_pointer_new.notify = handle_virtual_pointer; 452 input->virtual_pointer_new.notify = handle_virtual_pointer;
482 453
483 input->inhibit = wlr_input_inhibit_manager_create(server->wl_display);
484 input->inhibit_activate.notify = handle_inhibit_activate;
485 wl_signal_add(&input->inhibit->events.activate,
486 &input->inhibit_activate);
487 input->inhibit_deactivate.notify = handle_inhibit_deactivate;
488 wl_signal_add(&input->inhibit->events.deactivate,
489 &input->inhibit_deactivate);
490
491 input->keyboard_shortcuts_inhibit = 454 input->keyboard_shortcuts_inhibit =
492 wlr_keyboard_shortcuts_inhibit_v1_create(server->wl_display); 455 wlr_keyboard_shortcuts_inhibit_v1_create(server->wl_display);
493 input->keyboard_shortcuts_inhibit_new_inhibitor.notify = 456 input->keyboard_shortcuts_inhibit_new_inhibitor.notify =
diff --git a/sway/server.c b/sway/server.c
index 217c9ac9..de70e0ab 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -87,7 +87,6 @@ static bool is_privileged(const struct wl_global *global) {
87 global == server.gamma_control_manager_v1->global || 87 global == server.gamma_control_manager_v1->global ||
88 global == server.layer_shell->global || 88 global == server.layer_shell->global ||
89 global == server.session_lock.manager->global || 89 global == server.session_lock.manager->global ||
90 global == server.input->inhibit->global ||
91 global == server.input->keyboard_shortcuts_inhibit->global || 90 global == server.input->keyboard_shortcuts_inhibit->global ||
92 global == server.input->virtual_keyboard->global || 91 global == server.input->virtual_keyboard->global ||
93 global == server.input->virtual_pointer->global; 92 global == server.input->virtual_pointer->global;