mirror of
https://github.com/swaywm/sway.git
synced 2026-05-05 06:46:49 -04:00
Implement relative pointer v1 protocol
Pretty much a copy-paste from rootston
This commit is contained in:
parent
020edf5b49
commit
5397d1f6ef
2 changed files with 8 additions and 1 deletions
|
|
@ -167,7 +167,11 @@ static void handle_cursor_motion(struct wl_listener *listener, void *data) {
|
||||||
if (!cursor->locked) {
|
if (!cursor->locked) {
|
||||||
wlr_cursor_move(cursor->cursor, event->device,
|
wlr_cursor_move(cursor->cursor, event->device,
|
||||||
event->delta_x, event->delta_y);
|
event->delta_x, event->delta_y);
|
||||||
cursor_send_pointer_motion(cursor, event->time_msec);
|
cursor_send_pointer_motion(cursor, event->time_usec / 1000);
|
||||||
|
} else {
|
||||||
|
wlr_seat_pointer_notify_relative_motion(cursor->seat->wlr_seat,
|
||||||
|
event->time_usec, event->delta_x, event->delta_y,
|
||||||
|
event->noaccel.delta_x, event->noaccel.delta_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include <wlr/types/wlr_linux_dmabuf.h>
|
#include <wlr/types/wlr_linux_dmabuf.h>
|
||||||
#include <wlr/types/wlr_layer_shell.h>
|
#include <wlr/types/wlr_layer_shell.h>
|
||||||
#include <wlr/types/wlr_primary_selection.h>
|
#include <wlr/types/wlr_primary_selection.h>
|
||||||
|
#include <wlr/types/wlr_relative_pointer_v1.h>
|
||||||
#include <wlr/types/wlr_screenshooter.h>
|
#include <wlr/types/wlr_screenshooter.h>
|
||||||
#include <wlr/types/wlr_server_decoration.h>
|
#include <wlr/types/wlr_server_decoration.h>
|
||||||
#include <wlr/types/wlr_xcursor_manager.h>
|
#include <wlr/types/wlr_xcursor_manager.h>
|
||||||
|
|
@ -132,6 +133,8 @@ bool server_init(struct sway_server *server) {
|
||||||
wl_signal_add(&server->pointer_constraints->events.request_constraint,
|
wl_signal_add(&server->pointer_constraints->events.request_constraint,
|
||||||
&server->request_constraint);
|
&server->request_constraint);
|
||||||
|
|
||||||
|
wlr_relative_pointer_manager_v1_create(server->wl_display);
|
||||||
|
|
||||||
input_manager = input_manager_create(server);
|
input_manager = input_manager_create(server);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue