mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-09 13:29:46 -05:00
Allow to update the cursor hotspot without its pixels
This commit is contained in:
parent
5c6a933890
commit
92daa790bb
5 changed files with 34 additions and 11 deletions
|
|
@ -127,7 +127,7 @@ static bool set_cursor(struct wlr_output *output, const uint8_t *buf,
|
|||
int32_t hotspot_y) {
|
||||
if (output->impl->set_cursor
|
||||
&& output->impl->set_cursor(output, buf, stride, width, height,
|
||||
hotspot_x, hotspot_y)) {
|
||||
hotspot_x, hotspot_y, true)) {
|
||||
output->cursor.is_sw = false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -238,6 +238,15 @@ void wlr_output_set_cursor_surface(struct wlr_output *output,
|
|||
output->cursor.hotspot_x = hotspot_x;
|
||||
output->cursor.hotspot_y = hotspot_y;
|
||||
|
||||
if (surface && surface == output->cursor.surface) {
|
||||
if (output->impl->set_cursor && !output->cursor.is_sw) {
|
||||
// Only update the hotspot
|
||||
output->impl->set_cursor(output, NULL, 0, 0, 0, hotspot_x,
|
||||
hotspot_y, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (output->cursor.surface) {
|
||||
wl_list_remove(&output->cursor.surface_commit.link);
|
||||
wl_list_remove(&output->cursor.surface_destroy.link);
|
||||
|
|
|
|||
|
|
@ -427,8 +427,9 @@ static void wlr_surface_commit_pending(struct wlr_surface *surface) {
|
|||
// TODO: add the invalid bitfield to this callback
|
||||
wl_signal_emit(&surface->events.commit, surface);
|
||||
|
||||
// TODO: call this
|
||||
//wlr_surface_state_release_buffer(surface->current);
|
||||
// Release the buffer after calling commit, because some listeners
|
||||
// might need it (e.g. for cursor surfaces)
|
||||
wlr_surface_state_release_buffer(surface->current);
|
||||
}
|
||||
|
||||
static bool wlr_subsurface_is_synchronized(struct wlr_subsurface *subsurface) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue