ibeam cursor: apply view attribs.cursor when pointer enters WINGs view
Text fields set view->cursor = textCursor ("xterm") at creation.
When the pointer moves into a different WINGs child view, apply
the view cursor via W_SetCursorImageFn instead of waiting for
WME_MOTION with pointerGrabbed.
This commit is contained in:
parent
9089c3637d
commit
c6eba5ed58
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
/* Forward declarations for functions defined in other wl_*.c files */
|
||||
void W_WL_EnqueueEvent(struct W_Screen *scr, const WMEvent *ev, struct W_View *target);
|
||||
extern void (*W_SetCursorImageFn)(const char *name);
|
||||
void wl_grab_apply_motion(void);
|
||||
void wl_update_pointer_focus(uint32_t time_msec);
|
||||
WMScreen *wl_get_wmscreen(void);
|
||||
|
|
@ -151,6 +152,13 @@ handle_pointer_motion(struct wl_listener *listener, void *data)
|
|||
W_WL_EnqueueEvent(wmscr, &cev, mtarget);
|
||||
}
|
||||
wl_state.last_hovered_view = mtarget;
|
||||
/* Apply the new view's cursor shape */
|
||||
if (mtarget && mtarget->cursor && W_SetCursorImageFn) {
|
||||
const char *cname = (const char *)(uintptr_t)mtarget->cursor;
|
||||
W_SetCursorImageFn(cname);
|
||||
} else if (W_SetCursorImageFn) {
|
||||
W_SetCursorImageFn("left_ptr");
|
||||
}
|
||||
}
|
||||
/* Emit synthetic LEAVE/ENTER when pointer crosses WM sub-window
|
||||
* boundaries (titlebar ↔ button, etc.). These feed the inner
|
||||
|
|
|
|||
Loading…
Reference in New Issue