wl_backend: implement pointer_change_grab — update cursor during move/resize

This commit is contained in:
Ollie 2026-05-29 08:00:28 +02:00
parent 0f3ce45d38
commit 2577050f44
1 changed files with 16 additions and 1 deletions

View File

@ -6524,7 +6524,22 @@ wl_pointer_query_full(WNativeWindow root,
static void
wl_pointer_change_grab(unsigned int event_mask, int cursor_id,
unsigned long timestamp)
{ (void)event_mask; (void)cursor_id; (void)timestamp; }
{
(void)event_mask; (void)timestamp;
/* Map WCUR_* cursor IDs to xcursor names */
const char *name;
switch (cursor_id) {
case WCUR_MOVE: name = "fleur"; break;
case WCUR_TOPLEFTRESIZE: name = "nw-resize"; break;
case WCUR_TOPRIGHTRESIZE: name = "ne-resize"; break;
case WCUR_BOTTOMLEFTRESIZE: name = "sw-resize"; break;
case WCUR_BOTTOMRIGHTRESIZE: name = "se-resize"; break;
case WCUR_VERTICALRESIZE: name = "n-resize"; break;
case WCUR_HORIZONRESIZE: name = "e-resize"; break;
default: name = "left_ptr"; break;
}
wl_set_cursor_image(name);
}
/* ------------------------------------------------------------------ */
/* Keyboard grabs */