wxWindow* focus = wxWindow::FindFocus() ;
event.SetEventObject(focus);
- if ( (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey )
+ if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & controlKey )
{
event.m_keyCode = WXK_CONTROL ;
event.SetEventType( ( modifiers & controlKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ;
}
- if ( (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey )
+ if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & shiftKey )
{
event.m_keyCode = WXK_SHIFT ;
event.SetEventType( ( modifiers & shiftKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
focus->GetEventHandler()->ProcessEvent( event ) ;
}
- if ( (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey )
+ if ( focus && (modifiers ^ wxTheApp->s_lastModifiers ) & optionKey )
{
event.m_keyCode = WXK_ALT ;
event.SetEventType( ( modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
RgnHandle diffRgn = NewRgn() ;
if ( updateRgn && diffRgn )
{
+#if 1
+ // macos internal control redraws clean up areas we'd like to redraw ourselves
+ // therefore we pick the boundary rect and make sure we can redraw it
+ RgnHandle trueUpdateRgn = NewRgn() ;
+ Rect trueUpdateRgnBoundary ;
+ GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), trueUpdateRgn );
+ GetRegionBounds( trueUpdateRgn , &trueUpdateRgnBoundary ) ;
+ RectRgn( (RgnHandle) updateRgn , &trueUpdateRgnBoundary ) ;
+ if ( trueUpdateRgn )
+ DisposeRgn( trueUpdateRgn ) ;
+ SetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn ) ;
+#else
GetPortVisibleRegion( GetWindowPort( (WindowRef)m_macWindow ), updateRgn );
+#endif
DiffRgn( updateRgn , (RgnHandle) m_macNoEraseUpdateRgn , diffRgn ) ;
if ( !EmptyRgn( updateRgn ) )
{
// so refresh the whole window on activation and deactivation.
long osVersion = UMAGetSystemVersion();
if (osVersion >= 0x1000 && osVersion < 0x1020)
+ {
Refresh(TRUE);
+ }
else
- MacSuperEnabled( inIsActivating ) ;
+ {
+ // for the moment we have to resolve some redrawing issues like this
+ // the OS is stealing some redrawing areas as soon as it draws a control
+ Refresh(TRUE);
+ }
}
#if !TARGET_CARBON
if (show)
{
- ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil);
+ // this is leading to incorrect window layering in some situations
+ // ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowShowTransitionAction,nil);
+ ::ShowWindow( (WindowRef)m_macWindow ) ;
::SelectWindow( (WindowRef)m_macWindow ) ;
// no need to generate events here, they will get them triggered by macos
// actually they should be , but apparently they are not
}
else
{
- ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil);
+ // this is leading to incorrect window layering in some situations
+ // ::TransitionWindow((WindowRef)m_macWindow,kWindowZoomTransitionEffect,kWindowHideTransitionAction,nil);
+ ::HideWindow( (WindowRef)m_macWindow ) ;
}
if ( !show )