From 746e3759b7a350a5e9124f365cac0279810781d1 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 30 Mar 2018 19:33:57 -0400 Subject: Address review feedback --- examples/layer-shell.c | 4 ++-- rootston/cursor.c | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/layer-shell.c b/examples/layer-shell.c index 3f955be4..89fa9ea9 100644 --- a/examples/layer-shell.c +++ b/examples/layer-shell.c @@ -162,8 +162,8 @@ static void wl_pointer_leave(void *data, struct wl_pointer *wl_pointer, static void wl_pointer_motion(void *data, struct wl_pointer *wl_pointer, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) { - cur_x = (int)wl_fixed_to_double(surface_x); - cur_y = (int)wl_fixed_to_double(surface_y); + cur_x = wl_fixed_to_int(surface_x); + cur_y = wl_fixed_to_int(surface_y); } static void wl_pointer_button(void *data, struct wl_pointer *wl_pointer, diff --git a/rootston/cursor.c b/rootston/cursor.c index 1a7526d1..1ee195c2 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -101,18 +101,21 @@ 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) { - struct roots_view *view; double sx, sy; - + struct roots_view *view = NULL; struct roots_seat *seat = cursor->seat; 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 && cursor->cursor_client) { + if (cursor->cursor_client != client) { wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager, cursor->default_xcursor, cursor->cursor); - cursor->cursor_client = NULL; + cursor->cursor_client = client; } if (view) { -- cgit v1.2.3