1. handle Alt-F4 in wxUniv, not wxMGL
2. safeguards to never warp pointer to out-of-screen location (MGL would crash) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -440,14 +440,7 @@ static bool wxHandleSpecialKeys(wxKeyEvent& event)
|
|||||||
wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);
|
wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( event.m_keyCode == WXK_F4 && event.m_altDown &&
|
|
||||||
gs_activeFrame != NULL )
|
|
||||||
{
|
|
||||||
gs_activeFrame->Close();
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -830,7 +823,19 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor)
|
|||||||
|
|
||||||
void wxWindowMGL::WarpPointer(int x, int y)
|
void wxWindowMGL::WarpPointer(int x, int y)
|
||||||
{
|
{
|
||||||
|
int w, h;
|
||||||
|
wxDisplaySize(&w, &h);
|
||||||
|
|
||||||
ClientToScreen(&x, &y);
|
ClientToScreen(&x, &y);
|
||||||
|
if ( x < 0 )
|
||||||
|
x = 0;
|
||||||
|
if ( y < 0 )
|
||||||
|
y = 0;
|
||||||
|
if ( x >= w )
|
||||||
|
x = w-1;
|
||||||
|
if ( y >= h )
|
||||||
|
y = h-1;
|
||||||
|
|
||||||
EVT_setMousePos(x, y);
|
EVT_setMousePos(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user