Allow to update the cursor hotspot without its pixels

This commit is contained in:
emersion 2017-10-12 09:40:51 +02:00
parent 5c6a933890
commit 92daa790bb
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
5 changed files with 34 additions and 11 deletions

View file

@ -54,11 +54,18 @@ static void wlr_wl_output_transform(struct wlr_output *_output,
static bool wlr_wl_output_set_cursor(struct wlr_output *_output,
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height,
int32_t hotspot_x, int32_t hotspot_y) {
int32_t hotspot_x, int32_t hotspot_y, bool update_pixels) {
struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)_output;
struct wlr_wl_backend *backend = output->backend;
if (!update_pixels) {
// Update hotspot without changing cursor image
wlr_wl_output_update_cursor(output, output->enter_serial, hotspot_x,
hotspot_y);
return true;
}
if (!buf) {
// Hide cursor
wl_pointer_set_cursor(output->backend->pointer, output->enter_serial,
NULL, 0, 0);
return true;