aboutsummaryrefslogtreecommitdiff
path: root/rootston/seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/seat.c')
-rw-r--r--rootston/seat.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index f308da52..1ae098bc 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -1,4 +1,4 @@
-#define _POSIX_C_SOURCE 199309L
+#define _POSIX_C_SOURCE 200112L
#include <assert.h>
#include <libinput.h>
#include <stdlib.h>
@@ -127,13 +127,13 @@ static void handle_tablet_tool_position(struct roots_cursor *cursor,
struct wlr_surface *surface = desktop_surface_at(desktop,
cursor->cursor->x, cursor->cursor->y, &sx, &sy, &view);
struct roots_tablet_tool *roots_tool = tool->data;
-
+
if (!surface) {
wlr_tablet_v2_tablet_tool_notify_proximity_out(roots_tool->tablet_v2_tool);
/* XXX: TODO: Fallback pointer semantics */
return;
}
-
+
if (!wlr_surface_accepts_tablet_v2(tablet->tablet_v2, surface)) {
wlr_tablet_v2_tablet_tool_notify_proximity_out(roots_tool->tablet_v2_tool);
/* XXX: TODO: Fallback pointer semantics */
@@ -218,7 +218,7 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) {
static void handle_tablet_tool_destroy(struct wl_listener *listener, void *data) {
struct roots_tablet_tool *tool =
wl_container_of(listener, tool, tool_destroy);
-
+
wl_list_remove(&tool->link);
wl_list_remove(&tool->tool_link);
@@ -503,16 +503,16 @@ void roots_drag_icon_update_position(struct roots_drag_icon *icon) {
struct roots_seat *seat = icon->seat;
struct wlr_cursor *cursor = seat->cursor->cursor;
if (wlr_icon->is_pointer) {
- icon->x = cursor->x + wlr_icon->sx;
- icon->y = cursor->y + wlr_icon->sy;
+ icon->x = cursor->x;
+ icon->y = cursor->y;
} else {
struct wlr_touch_point *point =
wlr_seat_touch_get_point(seat->seat, wlr_icon->touch_id);
if (point == NULL) {
return;
}
- icon->x = seat->touch_x + wlr_icon->sx;
- icon->y = seat->touch_y + wlr_icon->sy;
+ icon->x = seat->touch_x;
+ icon->y = seat->touch_y;
}
roots_drag_icon_damage_whole(icon);
@@ -746,6 +746,7 @@ static void attach_tablet_pad(struct roots_tablet_pad *pad,
pad->tablet = tool;
+ wl_list_remove(&pad->tablet_destroy.link);
pad->tablet_destroy.notify = handle_pad_tool_destroy;
wl_signal_add(&tool->device->events.destroy, &pad->tablet_destroy);
}
@@ -813,7 +814,8 @@ static void seat_add_tablet_pad(struct roots_seat *seat,
&tablet_pad->device_destroy);
tablet_pad->attach.notify = handle_tablet_pad_attach;
- wl_signal_add(&tablet_pad->device->tablet_pad->events.attach_tablet, &tablet_pad->attach);
+ wl_signal_add(&tablet_pad->device->tablet_pad->events.attach_tablet,
+ &tablet_pad->attach);
tablet_pad->button.notify = handle_tablet_pad_button;
wl_signal_add(&tablet_pad->device->tablet_pad->events.button, &tablet_pad->button);
@@ -824,6 +826,8 @@ static void seat_add_tablet_pad(struct roots_seat *seat,
tablet_pad->ring.notify = handle_tablet_pad_ring;
wl_signal_add(&tablet_pad->device->tablet_pad->events.ring, &tablet_pad->ring);
+ wl_list_init(&tablet_pad->tablet_destroy.link);
+
struct roots_desktop *desktop = seat->input->server->desktop;
tablet_pad->tablet_v2_pad =
wlr_tablet_pad_create(desktop->tablet_v2, seat->seat, device);
@@ -1125,7 +1129,8 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
#ifdef WLR_HAS_XWAYLAND
if (view && view->type == ROOTS_XWAYLAND_VIEW &&
- wlr_xwayland_surface_is_unmanaged(view->xwayland_surface)) {
+ !wlr_xwayland_or_surface_wants_focus(
+ view->xwayland_surface)) {
return;
}
#endif