diff options
author | Las <las@protonmail.ch> | 2018-08-08 13:43:44 +0200 |
---|---|---|
committer | Las <las@protonmail.ch> | 2018-09-18 10:14:33 +0200 |
commit | 59dd1dddbabb93569d06fb5612cb8178a9a50c1e (patch) | |
tree | 17630a1ce41c34f89f11f0c2d91ca3c9cc5addd0 /rootston/cursor.c | |
parent | d446c53fe1794625b9f0c0df9eee00e198401ff8 (diff) |
Update pointer focus when cycling focus
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r-- | rootston/cursor.c | 12 |
1 files changed, 9 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; |