diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-06-15 11:36:17 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Sun.COM> | 2010-06-15 11:36:17 +0200 |
commit | 87055f74bc238bc3c54d839e7e1319a871a3f8e7 (patch) | |
tree | 8730fedcb3b2dfaac14986d5002d668c24c2d1fc /vcl/unx/source/window | |
parent | c53cc530f5644c032f3fc93daf31e9301c5e302b (diff) |
ooo30gsl01: #i112270# need to get focus on toolwindows explicitly
Diffstat (limited to 'vcl/unx/source/window')
-rw-r--r-- | vcl/unx/source/window/salframe.cxx | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx index 6d243e41db8c..b0248662a2a2 100644 --- a/vcl/unx/source/window/salframe.cxx +++ b/vcl/unx/source/window/salframe.cxx @@ -665,6 +665,7 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD mhStackingWindow = None; mhForeignParent = None; mhBackgroundPixmap = None; + m_bSetFocusOnMap = false; pGraphics_ = NULL; pFreeGraphics_ = NULL; @@ -1226,14 +1227,11 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate ) } XLIB_Time nUserTime = 0; - if( ! bNoActivate && (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) - { - if( GetDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") ) - nUserTime = pDisplay_->GetLastUserEventTime( true ); - else - nUserTime = pDisplay_->GetLastUserEventTime(); - } + if( ! bNoActivate && (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) == 0 ) + nUserTime = pDisplay_->GetLastUserEventTime( true ); GetDisplay()->getWMAdaptor()->setUserTime( this, nUserTime ); + if( ! bNoActivate && (nStyle_ & SAL_FRAME_STYLE_TOOLWINDOW) ) + m_bSetFocusOnMap = true; // actually map the window if( m_bXEmbed ) @@ -4172,6 +4170,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) &aEvent ); } + bool bSetFocus = m_bSetFocusOnMap; /* #99570# another workaround for sawfish: if a transient window for the same parent is shown * sawfish does not set the focus to it. Applies only for click to focus mode. */ @@ -4181,7 +4180,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) // since this will lead to a parent loose-focus, close status, // reget focus, open status, .... flicker loop if ( (I18NStatus::get().getStatusFrame() != this) ) - XSetInputFocus( GetXDisplay(), GetShellWindow(), RevertToParent, CurrentTime ); + bSetFocus = true; } /* @@ -4219,10 +4218,21 @@ long X11SalFrame::Dispatch( XEvent *pEvent ) mpParent->GetShellWindow(), RevertToParent, CurrentTime ); + bSetFocus = false; + } + + if( bSetFocus ) + { + XSetInputFocus( GetXDisplay(), + GetShellWindow(), + RevertToParent, + CurrentTime ); } + RestackChildren(); mbInShow = FALSE; + m_bSetFocusOnMap = false; } break; |