Merge branch 'master' into clipboard

This commit is contained in:
Camilla Berglund
2012-03-28 14:58:03 +02:00
12 changed files with 163 additions and 20 deletions
+36 -1
View File
@@ -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