summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-01 21:25:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-02 14:03:12 +0000
commit6f9ce98bd0b33e4823f1f99314a478efb9ce0638 (patch)
treeef6178ee7dfb382c2d92e086e8ee882c10e8927e /vcl
parentb0d1a39e995871ef81cb58e8f1587a771fdd2deb (diff)
support unfocused float window inside a focused float window
if a floating window is inside a floating window, go up the floating windows until we find the first one that accepts focus, rather than pass the input to the toplevel frame Change-Id: I6c2a3de02ab436b8441b1fec15d51dec4f96c931
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/winproc.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 43e5692c396b..170e94665a4d 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -813,12 +813,23 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow )
// find window - is every time the window which has currently the
// focus or the last time the focus.
- // the first floating window always has the focus
+
+ // the first floating window always has the focus, try it, or any parent floating windows, first
vcl::Window* pChild = pSVData->maWinData.mpFirstFloat;
- if( !pChild || ( pChild->ImplGetWindowImpl()->mbFloatWin && !static_cast<FloatingWindow *>(pChild)->GrabsFocus() ) )
- pChild = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
- else
- pChild = pChild->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
+ while (pChild)
+ {
+ if (pChild->ImplGetWindowImpl()->mbFloatWin)
+ {
+ if (static_cast<FloatingWindow *>(pChild)->GrabsFocus())
+ break;
+ }
+ pChild = pChild->GetParent();
+ }
+
+ if (!pChild)
+ pChild = pWindow;
+
+ pChild = pChild->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
// no child - than no input
if ( !pChild )