mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 23:33:16 +01:00
wayland: Implement 'DISABLED' cursor mode
This implements support for the 'DISABLED' cursor mode, which effectively means locking the pointer to the surface. The cursor is also explicitly hidden. This adds two new build dependencies: wayland-scanner and wayland-protocols. Closes #708.
This commit is contained in:
committed by
Camilla Berglund
parent
c7f3bd0d22
commit
cb08dc574c
@@ -84,12 +84,7 @@ static void pointerHandleMotion(void* data,
|
||||
return;
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
/* TODO */
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Wayland: GLFW_CURSOR_DISABLED not supported");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
window->wl.cursorPosX = wl_fixed_to_double(sx);
|
||||
@@ -413,6 +408,20 @@ static void registryHandleGlobal(void* data,
|
||||
wl_seat_add_listener(_glfw.wl.seat, &seatListener, NULL);
|
||||
}
|
||||
}
|
||||
else if (strcmp(interface, "zwp_relative_pointer_manager_v1") == 0)
|
||||
{
|
||||
_glfw.wl.relativePointerManager =
|
||||
wl_registry_bind(registry, name,
|
||||
&zwp_relative_pointer_manager_v1_interface,
|
||||
1);
|
||||
}
|
||||
else if (strcmp(interface, "zwp_pointer_constraints_v1") == 0)
|
||||
{
|
||||
_glfw.wl.pointerConstraints =
|
||||
wl_registry_bind(registry, name,
|
||||
&zwp_pointer_constraints_v1_interface,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
static void registryHandleGlobalRemove(void *data,
|
||||
|
||||
Reference in New Issue
Block a user