mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Merge branch 'master' into clipboard
This commit is contained in:
+36
-1
@@ -685,7 +685,8 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
wa.border_pixel = 0;
|
||||
wa.event_mask = StructureNotifyMask | KeyPressMask | KeyReleaseMask |
|
||||
PointerMotionMask | ButtonPressMask | ButtonReleaseMask |
|
||||
ExposureMask | FocusChangeMask | VisibilityChangeMask;
|
||||
ExposureMask | FocusChangeMask | VisibilityChangeMask |
|
||||
EnterWindowMask | LeaveWindowMask;
|
||||
|
||||
if (wndconfig->mode == GLFW_WINDOWED)
|
||||
{
|
||||
@@ -1186,6 +1187,40 @@ static void processSingleEvent(void)
|
||||
break;
|
||||
}
|
||||
|
||||
case EnterNotify:
|
||||
{
|
||||
// The mouse cursor enters the Window
|
||||
window = findWindow(event.xcrossing.window);
|
||||
if (window == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot find GLFW window structure for EnterNotify event\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||
hideMouseCursor(window);
|
||||
|
||||
_glfwInputCursorEnter(window, GL_TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
case LeaveNotify:
|
||||
{
|
||||
// The mouse cursor leave the Window
|
||||
window = findWindow(event.xcrossing.window);
|
||||
if (window == NULL)
|
||||
{
|
||||
fprintf(stderr, "Cannot find GLFW window structure for LeaveNotify event\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->cursorMode == GLFW_CURSOR_HIDDEN)
|
||||
showMouseCursor(window);
|
||||
|
||||
_glfwInputCursorEnter(window, GL_FALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
case MotionNotify:
|
||||
{
|
||||
// The mouse cursor was moved
|
||||
|
||||
Reference in New Issue
Block a user