diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-11-04 22:34:09 +0000 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-11-07 13:34:06 +0100 |
commit | 6f521e8b7d0fb60f173be56808559cac2e0c3a14 (patch) | |
tree | 43093c6fe131cc21c1f3b0f42ba43a27014c0313 /vcl/unx/generic/window/salframe.cxx | |
parent | 9b76fa7fc51f178382c14e9ad8b56549c335cbc1 (diff) |
tdf#112770 Filter input on the correct window
This filters the input event on the correct window in
SalX11Display::Dispatch.
I'm not sure there is a point of skipping the filter for input
events, which are not on our windows, as we already filter all
non-key input events. Has been like that in the initial import,
but whi knows what input methods do with different events...
After reviewing the original "Unify SalUserEvent handling" commit
e310c00709ed4fe0788aeff5142e3581d8b4d319, I found two more places,
which now have handled user events wrong and fixed them.
Change-Id: I50a60f6dacc3f795e659b6fbfd107548d07a3341
Reviewed-on: https://gerrit.libreoffice.org/44371
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx/generic/window/salframe.cxx')
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 03fc70c40676..4e62877f40e0 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -492,14 +492,17 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen // check if this is really one of our own frames // do not change the input mask in that case + bool bIsReallyOurFrame = false; for (auto pSalFrame : GetDisplay()->getFrames() ) - { if ( static_cast<const X11SalFrame*>( pSalFrame )->GetWindow() == mhForeignParent ) { - XSelectInput( GetDisplay()->GetDisplay(), mhForeignParent, StructureNotifyMask | FocusChangeMask ); - XSelectInput( GetDisplay()->GetDisplay(), mhShellWindow, StructureNotifyMask | FocusChangeMask ); + bIsReallyOurFrame = true; break; } + if (!bIsReallyOurFrame) + { + XSelectInput( GetDisplay()->GetDisplay(), mhForeignParent, StructureNotifyMask | FocusChangeMask ); + XSelectInput( GetDisplay()->GetDisplay(), mhShellWindow, StructureNotifyMask | FocusChangeMask ); } } else @@ -520,6 +523,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen { // find the last document window (if any) const X11SalFrame* pFrame = nullptr; + bool bIsDocumentWindow = false; for (auto pSalFrame : GetDisplay()->getFrames() ) { pFrame = static_cast< const X11SalFrame* >( pSalFrame ); @@ -530,10 +534,13 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen || ! pFrame->GetUnmirroredGeometry().nHeight ) ) + { + bIsDocumentWindow = true; break; + } } - if( pFrame ) + if( bIsDocumentWindow ) { // set a document position and size // the first frame gets positioned by the window manager |