mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 01:28:19 +03:00
glfw x11: update cursor position on enter event
kitty would have an incorrect position when clicking after changing window without moving (e.g. change workspace, create new kitty etc) For new kitty window, initial position would be 0 and selection paste would not work because of this
This commit is contained in:
parent
8395076da5
commit
ec51a219a7
8
glfw/x11_window.c
vendored
8
glfw/x11_window.c
vendored
@ -1291,12 +1291,20 @@ static void processEvent(XEvent *event)
|
|||||||
|
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
{
|
{
|
||||||
|
// XEnterWindowEvent is XCrossingEvent
|
||||||
|
const int x = event->xcrossing.x;
|
||||||
|
const int y = event->xcrossing.y;
|
||||||
|
|
||||||
// HACK: This is a workaround for WMs (KWM, Fluxbox) that otherwise
|
// HACK: This is a workaround for WMs (KWM, Fluxbox) that otherwise
|
||||||
// ignore the defined cursor for hidden cursor mode
|
// ignore the defined cursor for hidden cursor mode
|
||||||
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||||
updateCursorImage(window);
|
updateCursorImage(window);
|
||||||
|
|
||||||
_glfwInputCursorEnter(window, GLFW_TRUE);
|
_glfwInputCursorEnter(window, GLFW_TRUE);
|
||||||
|
_glfwInputCursorPos(window, x, y);
|
||||||
|
|
||||||
|
window->x11.lastCursorPosX = x;
|
||||||
|
window->x11.lastCursorPosY = y;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user