aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-09 00:08:54 +0200
committeremersion <contact@emersion.fr>2017-10-09 00:08:54 +0200
commitc4c948c5d987ca03449635979e431abc19e46be0 (patch)
tree1b1078ab377b721f37748252c9ba0835f8fecdec
parent008e1d596d00614ab4ead873a96aa2220b88bcd7 (diff)
Use attach x,y when computing hotspot, set sx,sy in surface_attach
-rw-r--r--types/wlr_output.c3
-rw-r--r--types/wlr_surface.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index d772ea06..83d6713f 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -193,7 +193,8 @@ static void handle_cursor_surface_commit(struct wl_listener *listener,
int32_t stride = wl_shm_buffer_get_stride(buffer);
wl_shm_buffer_begin_access(buffer);
wlr_output_set_cursor(output, buffer_data, stride/4, width, height,
- output->cursor.hotspot_x, output->cursor.hotspot_y);
+ output->cursor.hotspot_x - surface->current->sx,
+ output->cursor.hotspot_y - surface->current->sy);
wl_shm_buffer_end_access(buffer);
}
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index e675ac69..7b620c6b 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -51,6 +51,8 @@ static void surface_attach(struct wl_client *client,
struct wlr_surface *surface = wl_resource_get_user_data(resource);
surface->pending->invalid |= WLR_SURFACE_INVALID_BUFFER;
+ surface->pending->sx = sx;
+ surface->pending->sy = sy;
wlr_surface_state_reset_buffer(surface->pending);
wlr_surface_state_set_buffer(surface->pending, buffer);
}