Fixed mouse move bug. No idea why it has to be fixed,
but MacOS X seems to send incorect event states. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1014,11 +1014,11 @@ void wxApp::MacDoOneEvent()
|
|||||||
{
|
{
|
||||||
EventRecord event ;
|
EventRecord event ;
|
||||||
|
|
||||||
long sleepTime = 1 ; // GetCaretTime() / 4 ;
|
long sleepTime = 1; // GetCaretTime() / 4 ;
|
||||||
|
|
||||||
if (WaitNextEvent(everyEvent, &event,sleepTime, s_macCursorRgn))
|
if (WaitNextEvent(everyEvent, &event, sleepTime, s_macCursorRgn))
|
||||||
{
|
{
|
||||||
MacHandleOneEvent( &event );
|
MacHandleOneEvent( &event );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1034,7 +1034,7 @@ void wxApp::MacDoOneEvent()
|
|||||||
|
|
||||||
// repeaters
|
// repeaters
|
||||||
|
|
||||||
DeletePendingObjects() ;
|
DeletePendingObjects() ;
|
||||||
wxMacProcessNotifierAndPendingEvents() ;
|
wxMacProcessNotifierAndPendingEvents() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1692,8 +1692,19 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
break ;
|
break ;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if ( s_lastMouseDown == 0 )
|
// if ( s_lastMouseDown == 0 )
|
||||||
ev->modifiers |= btnState ;
|
// ev->modifiers |= btnState ;
|
||||||
|
|
||||||
|
// Calling GetNextEvent with a zero event mask will always
|
||||||
|
// pass back a null event. However, it fills the EventRecord
|
||||||
|
// with the state of the modifier keys. This is needed since
|
||||||
|
// the modifier state returned by WaitForNextEvent often is
|
||||||
|
// wrong mouse move events. The attempt above to correct this
|
||||||
|
// didn't always work (under OS X at least).
|
||||||
|
|
||||||
|
EventRecord tmp;
|
||||||
|
::GetNextEvent(0, &tmp);
|
||||||
|
ev->modifiers = tmp.modifiers;
|
||||||
|
|
||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
if ( win )
|
if ( win )
|
||||||
|
@@ -1014,11 +1014,11 @@ void wxApp::MacDoOneEvent()
|
|||||||
{
|
{
|
||||||
EventRecord event ;
|
EventRecord event ;
|
||||||
|
|
||||||
long sleepTime = 1 ; // GetCaretTime() / 4 ;
|
long sleepTime = 1; // GetCaretTime() / 4 ;
|
||||||
|
|
||||||
if (WaitNextEvent(everyEvent, &event,sleepTime, s_macCursorRgn))
|
if (WaitNextEvent(everyEvent, &event, sleepTime, s_macCursorRgn))
|
||||||
{
|
{
|
||||||
MacHandleOneEvent( &event );
|
MacHandleOneEvent( &event );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1034,7 +1034,7 @@ void wxApp::MacDoOneEvent()
|
|||||||
|
|
||||||
// repeaters
|
// repeaters
|
||||||
|
|
||||||
DeletePendingObjects() ;
|
DeletePendingObjects() ;
|
||||||
wxMacProcessNotifierAndPendingEvents() ;
|
wxMacProcessNotifierAndPendingEvents() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1692,8 +1692,19 @@ void wxApp::MacHandleOSEvent( EventRecord *ev )
|
|||||||
break ;
|
break ;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if ( s_lastMouseDown == 0 )
|
// if ( s_lastMouseDown == 0 )
|
||||||
ev->modifiers |= btnState ;
|
// ev->modifiers |= btnState ;
|
||||||
|
|
||||||
|
// Calling GetNextEvent with a zero event mask will always
|
||||||
|
// pass back a null event. However, it fills the EventRecord
|
||||||
|
// with the state of the modifier keys. This is needed since
|
||||||
|
// the modifier state returned by WaitForNextEvent often is
|
||||||
|
// wrong mouse move events. The attempt above to correct this
|
||||||
|
// didn't always work (under OS X at least).
|
||||||
|
|
||||||
|
EventRecord tmp;
|
||||||
|
::GetNextEvent(0, &tmp);
|
||||||
|
ev->modifiers = tmp.modifiers;
|
||||||
|
|
||||||
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
wxWindow* win = wxFindWinFromMacWindow( window ) ;
|
||||||
if ( win )
|
if ( win )
|
||||||
|
File diff suppressed because it is too large
Load Diff
2503
src/mac/window.cpp
2503
src/mac/window.cpp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user