aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
authorLibravatar Andri Yngvason <andri@yngvason.is>2020-02-05 22:08:11 +0000
committerLibravatar Simon Ser <contact@emersion.fr>2020-02-10 21:54:00 +0100
commit803e89018ab899a44e1ca24758d981dff27d5986 (patch)
tree0fcde987bde54284a26cce5696d4ecc4c38b7d95 /sway/input/input-manager.c
parentswaybar: fix i3bar relative coordinates when scaling is used (diff)
downloadsway-803e89018ab899a44e1ca24758d981dff27d5986.tar.gz
sway-803e89018ab899a44e1ca24758d981dff27d5986.tar.zst
sway-803e89018ab899a44e1ca24758d981dff27d5986.zip
input: Map virtual-pointer to the requested output
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 592e6f45..4cc07fe6 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -7,10 +7,12 @@
7#include <wlr/types/wlr_input_inhibitor.h> 7#include <wlr/types/wlr_input_inhibitor.h>
8#include <wlr/types/wlr_virtual_keyboard_v1.h> 8#include <wlr/types/wlr_virtual_keyboard_v1.h>
9#include <wlr/types/wlr_virtual_pointer_v1.h> 9#include <wlr/types/wlr_virtual_pointer_v1.h>
10#include <wlr/types/wlr_cursor.h>
10#include "sway/config.h" 11#include "sway/config.h"
11#include "sway/input/input-manager.h" 12#include "sway/input/input-manager.h"
12#include "sway/input/libinput.h" 13#include "sway/input/libinput.h"
13#include "sway/input/seat.h" 14#include "sway/input/seat.h"
15#include "sway/input/cursor.h"
14#include "sway/ipc-server.h" 16#include "sway/ipc-server.h"
15#include "sway/server.h" 17#include "sway/server.h"
16#include "stringop.h" 18#include "stringop.h"
@@ -354,6 +356,11 @@ void handle_virtual_pointer(struct wl_listener *listener, void *data) {
354 input_device->device_destroy.notify = handle_device_destroy; 356 input_device->device_destroy.notify = handle_device_destroy;
355 357
356 seat_add_device(seat, input_device); 358 seat_add_device(seat, input_device);
359
360 if (event->suggested_output) {
361 wlr_cursor_map_input_to_output(seat->cursor->cursor, device,
362 event->suggested_output);
363 }
357} 364}
358 365
359struct sway_input_manager *input_manager_create(struct sway_server *server) { 366struct sway_input_manager *input_manager_create(struct sway_server *server) {