summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/app/saldisp.cxx2
-rw-r--r--vcl/unx/generic/app/wmadaptor.cxx25
-rw-r--r--vcl/unx/generic/window/salframe.cxx13
3 files changed, 37 insertions, 3 deletions
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 57afd6cdf875..8904dbd94907 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2328,7 +2328,7 @@ extern "C"
}
}
-Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const
+Time SalDisplay::GetEventTimeImpl( bool i_bAlwaysReget ) const
{
if( m_nLastUserEventTime == CurrentTime || i_bAlwaysReget )
{
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index 49669a220414..e9eddc605a8c 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -95,6 +95,7 @@ struct WMAdaptorProtocol
static const WMAdaptorProtocol aProtocolTab[] =
{
{ "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE", WMAdaptor::KDE_NET_WM_WINDOW_TYPE_OVERRIDE },
+ { "_NET_ACTIVE_WINDOW", WMAdaptor::NET_ACTIVE_WINDOW },
{ "_NET_CURRENT_DESKTOP", WMAdaptor::NET_CURRENT_DESKTOP },
{ "_NET_NUMBER_OF_DESKTOPS", WMAdaptor::NET_NUMBER_OF_DESKTOPS },
{ "_NET_WM_DESKTOP", WMAdaptor::NET_WM_DESKTOP },
@@ -2274,4 +2275,28 @@ void WMAdaptor::answerPing( X11SalFrame const * i_pFrame, XClientMessageEvent co
}
}
+void WMAdaptor::activateWindow( X11SalFrame *pFrame, Time nTimestamp )
+{
+ if (pFrame->bMapped_)
+ {
+ XEvent aEvent;
+
+ aEvent.xclient.type = ClientMessage;
+ aEvent.xclient.window = pFrame->GetShellWindow();
+ aEvent.xclient.message_type = m_aWMAtoms[ NET_ACTIVE_WINDOW ];
+ aEvent.xclient.format = 32;
+ aEvent.xclient.data.l[0] = 1;
+ aEvent.xclient.data.l[1] = nTimestamp;
+ aEvent.xclient.data.l[2] = None;
+ aEvent.xclient.data.l[3] = 0;
+ aEvent.xclient.data.l[4] = 0;
+
+ XSendEvent( m_pDisplay,
+ m_pSalDisplay->GetRootWindow( pFrame->GetScreenNumber() ),
+ False,
+ SubstructureNotifyMask | SubstructureRedirectMask,
+ &aEvent );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 4e62877f40e0..32a62bca51ed 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -1274,7 +1274,7 @@ void X11SalFrame::Show( bool bVisible, bool bNoActivate )
Time nUserTime = 0;
if( ! bNoActivate && !(nStyle_ & SalFrameStyleFlags::OWNERDRAWDECORATION) )
- nUserTime = pDisplay_->GetLastUserEventTime( true );
+ nUserTime = pDisplay_->GetX11ServerTime();
GetDisplay()->getWMAdaptor()->setUserTime( this, nUserTime );
if( ! bNoActivate && (nStyle_ & SalFrameStyleFlags::TOOLWINDOW) )
m_bSetFocusOnMap = true;
@@ -1435,8 +1435,17 @@ void X11SalFrame::ToTop( SalFrameToTop nFlags )
&& bMapped_ )
{
if( m_bXEmbed )
+ {
askForXEmbedFocus( 0 );
- else
+ return;
+ }
+
+ if ( nFlags & SalFrameToTop::GrabFocus )
+ {
+ Time nTimestamp = pDisplay_->GetX11ServerTime();
+ GetDisplay()->getWMAdaptor()->activateWindow( this, nTimestamp );
+ }
+ else if ( nFlags & SalFrameToTop::GrabFocusOnly )
XSetInputFocus( GetXDisplay(), aToTopWindow, RevertToParent, CurrentTime );
}
}