aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorLas <las@protonmail.ch>2018-08-08 13:43:44 +0200
committerLas <las@protonmail.ch>2018-09-18 10:14:33 +0200
commit59dd1dddbabb93569d06fb5612cb8178a9a50c1e (patch)
tree17630a1ce41c34f89f11f0c2d91ca3c9cc5addd0 /rootston
parentd446c53fe1794625b9f0c0df9eee00e198401ff8 (diff)
Update pointer focus when cycling focus
Diffstat (limited to 'rootston')
-rw-r--r--rootston/cursor.c12
-rw-r--r--rootston/seat.c4
2 files changed, 13 insertions, 3 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index 239acf9c..b7dd98ed 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -100,7 +100,7 @@ static void seat_view_deco_button(struct roots_seat_view *view, double sx,
}
static void roots_passthrough_cursor(struct roots_cursor *cursor,
- uint32_t time) {
+ int64_t time) {
bool focus_changed;
double sx, sy;
struct roots_view *view = NULL;
@@ -108,11 +108,13 @@ static void roots_passthrough_cursor(struct roots_cursor *cursor,
struct roots_desktop *desktop = seat->input->server->desktop;
struct wlr_surface *surface = desktop_surface_at(desktop,
cursor->cursor->x, cursor->cursor->y, &sx, &sy, &view);
+
struct wl_client *client = NULL;
if (surface) {
client = wl_resource_get_client(surface->resource);
}
- if (surface && !roots_seat_allow_input(cursor->seat, surface->resource)) {
+
+ if (surface && !roots_seat_allow_input(seat, surface->resource)) {
return;
}
@@ -145,7 +147,7 @@ static void roots_passthrough_cursor(struct roots_cursor *cursor,
if (surface) {
focus_changed = (seat->seat->pointer_state.focused_surface != surface);
wlr_seat_pointer_notify_enter(seat->seat, surface, sx, sy);
- if (!focus_changed) {
+ if (!focus_changed && time > 0) {
wlr_seat_pointer_notify_motion(seat->seat, time, sx, sy);
}
} else {
@@ -158,6 +160,10 @@ static void roots_passthrough_cursor(struct roots_cursor *cursor,
}
}
+void roots_cursor_update_focus(struct roots_cursor *cursor) {
+ roots_passthrough_cursor(cursor, -1);
+}
+
void roots_cursor_update_position(struct roots_cursor *cursor,
uint32_t time) {
struct roots_seat *seat = cursor->seat;
diff --git a/rootston/seat.c b/rootston/seat.c
index 507254d4..e888bfa5 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -1186,6 +1186,8 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
wlr_seat_keyboard_notify_enter(seat->seat, view->wlr_surface,
NULL, 0, NULL);
}
+
+ roots_cursor_update_focus(seat->cursor);
}
/**
@@ -1220,6 +1222,8 @@ void roots_seat_set_focus_layer(struct roots_seat *seat,
wlr_seat_keyboard_notify_enter(seat->seat, layer->surface,
NULL, 0, NULL);
}
+
+ roots_cursor_update_focus(seat->cursor);
}
void roots_seat_set_exclusive_client(struct roots_seat *seat,