mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Wayland KDE: Fix mouse cursor hiding not working in Plasma 6
kwin in Plasma 6 now requires usage of pointer_enter_serial instead of last received serial for wl_set_cursor_image(). Hopefully, this wont break any other compositors. Fixes #7265
This commit is contained in:
@@ -60,6 +60,8 @@ Detailed list of changes
|
|||||||
|
|
||||||
- Wayland KDE: Support :opt:`background_blur`
|
- Wayland KDE: Support :opt:`background_blur`
|
||||||
|
|
||||||
|
- Wayland KDE: Fix mouse cursor hiding not working in Plasma 6 (:iss:`7265`)
|
||||||
|
|
||||||
- A new option :opt:`terminfo_type` to allow passing the terminfo database embedded into the :envvar:`TERMINFO` env var directly instead of via a file
|
- A new option :opt:`terminfo_type` to allow passing the terminfo database embedded into the :envvar:`TERMINFO` env var directly instead of via a file
|
||||||
|
|
||||||
- Mouse reporting: Fix drag release event outside the window not being reported in legacy mouse reporting modes (:iss:`7244`)
|
- Mouse reporting: Fix drag release event outside the window not being reported in legacy mouse reporting modes (:iss:`7244`)
|
||||||
|
|||||||
38
glfw/wl_window.c
vendored
38
glfw/wl_window.c
vendored
@@ -197,6 +197,21 @@ glfw_cursor_shape_to_wayland_cursor_shape(GLFWCursorShape g) {
|
|||||||
#undef C
|
#undef C
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
commit_window_surface_if_safe(_GLFWwindow *window) {
|
||||||
|
// we only commit if the buffer attached to the surface is the correct size,
|
||||||
|
// which means that at least one frame is drawn after resizeFramebuffer()
|
||||||
|
if (!window->wl.waiting_for_swap_to_commit) {
|
||||||
|
wl_surface_commit(window->wl.surface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
set_cursor_surface(struct wl_surface *surface, int hotspot_x, int hotspot_y, const char *from_where) {
|
||||||
|
debug("Calling wl_pointer_set_cursor in %s with surface: %p and serial: %u\n", from_where, (void*)surface, _glfw.wl.pointer_enter_serial);
|
||||||
|
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointer_enter_serial, surface, hotspot_x, hotspot_y);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setCursorImage(_GLFWwindow* window, bool on_theme_change) {
|
setCursorImage(_GLFWwindow* window, bool on_theme_change) {
|
||||||
_GLFWcursorWayland defaultCursor = {.shape = GLFW_DEFAULT_CURSOR};
|
_GLFWcursorWayland defaultCursor = {.shape = GLFW_DEFAULT_CURSOR};
|
||||||
@@ -253,11 +268,7 @@ setCursorImage(_GLFWwindow* window, bool on_theme_change) {
|
|||||||
cursorWayland->yhot = image->hotspot_y;
|
cursorWayland->yhot = image->hotspot_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug("Calling wl_pointer_set_cursor in setCursorImage with surface: %p\n", (void*)surface);
|
set_cursor_surface(surface, cursorWayland->xhot / scale, cursorWayland->yhot / scale, "setCursorImage");
|
||||||
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial,
|
|
||||||
surface,
|
|
||||||
cursorWayland->xhot / scale,
|
|
||||||
cursorWayland->yhot / scale);
|
|
||||||
wl_surface_set_buffer_scale(surface, scale);
|
wl_surface_set_buffer_scale(surface, scale);
|
||||||
wl_surface_attach(surface, buffer, 0, 0);
|
wl_surface_attach(surface, buffer, 0, 0);
|
||||||
wl_surface_damage(surface, 0, 0,
|
wl_surface_damage(surface, 0, 0,
|
||||||
@@ -303,16 +314,6 @@ checkScaleChange(_GLFWwindow* window) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
commit_window_surface_if_safe(_GLFWwindow *window) {
|
|
||||||
// we only commit if the buffer attached to the surface is the correct size,
|
|
||||||
// which means that at least one frame is drawn after resizeFramebuffer()
|
|
||||||
if (!window->wl.waiting_for_swap_to_commit) {
|
|
||||||
wl_surface_commit(window->wl.surface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_regions(_GLFWwindow* window) {
|
update_regions(_GLFWwindow* window) {
|
||||||
if (window->wl.transparent && !window->wl.org_kde_kwin_blur) return;
|
if (window->wl.transparent && !window->wl.org_kde_kwin_blur) return;
|
||||||
@@ -1763,9 +1764,7 @@ static void lockPointer(_GLFWwindow* window)
|
|||||||
window->wl.pointerLock.relativePointer = relativePointer;
|
window->wl.pointerLock.relativePointer = relativePointer;
|
||||||
window->wl.pointerLock.lockedPointer = lockedPointer;
|
window->wl.pointerLock.lockedPointer = lockedPointer;
|
||||||
|
|
||||||
debug("Calling wl_pointer_set_cursor in lockPointer with surface: %p\n", NULL);
|
set_cursor_surface(NULL, 0, 0, "lockPointer");
|
||||||
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial,
|
|
||||||
NULL, 0, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isPointerLocked(_GLFWwindow* window)
|
static bool isPointerLocked(_GLFWwindow* window)
|
||||||
@@ -1800,8 +1799,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
|
|||||||
}
|
}
|
||||||
else if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
else if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||||
{
|
{
|
||||||
debug("Calling wl_pointer_set_cursor in _glfwPlatformSetCursor with surface: %p\n", NULL);
|
set_cursor_surface(NULL, 0, 0, "_glfwPlatformSetCursor");
|
||||||
wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial, NULL, 0, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user