[Libreoffice-commits] core.git: 2 commits - vcl/source

Caolán McNamara caolanm at redhat.com
Thu May 12 10:32:57 UTC 2016


 vcl/source/app/svapp.cxx |   44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

New commits:
commit 3beb77bb6753a77b7d801fdc65fad78b98331813
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 12 11:30:14 2016 +0100

    Resolves: tdf#99464 don't allow a menu as a dialog parent
    
    which is an issue since...
    
    commit dd46727b99d4bb5135451aa7e5e1bdb197373843
    Author: Caolán McNamara <caolanm at redhat.com>
    Date:   Tue Apr 5 15:27:38 2016 +0100
    
        Resolves; tdf#87120 no keyboard navigation inside floating windows
    
        lets try and treat these the same as we do normal toplevels
        like dialogs if they popup with GrabFocus.
    
        This way focus can be set on widgets inside the floating windows, and
        so keyboard traversal of widgets etc all works.
    
    which allows keyboard focus inside floatinging windows to allow
    a11y keyboard navigation inside them without jumping through difficult hoops.
    
    Its typically better to explicitly set the parent of the dialog rather
    than depend no the auto-search stuff
    
    Change-Id: I869f3ef6c86d32dd9a1f5b53a2677be9f16a1598

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 76947cf..1374a7a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1442,7 +1442,7 @@ vcl::Window* Application::GetDefDialogParent()
 
     // current focus frame
     vcl::Window *pWin = pSVData->maWinData.mpFocusWin;
-    if (pWin)
+    if (pWin && !pWin->IsMenuFloatingWindow())
     {
         while (pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent)
             pWin = pWin->mpWindowImpl->mpParent;
commit 9226f602bade8a153fe2d5877cc47856cdcffd0c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 12 11:27:11 2016 +0100

    rejig for legibility, no logic change
    
    Change-Id: I73418e29dd85488613ea5c54ca8d505715ed3cbf

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 5a2ae0c..76947cf 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1441,51 +1441,51 @@ vcl::Window* Application::GetDefDialogParent()
     // as DefDialogParent
 
     // current focus frame
-    vcl::Window *pWin = nullptr;
-    if( (pWin = pSVData->maWinData.mpFocusWin) != nullptr )
+    vcl::Window *pWin = pSVData->maWinData.mpFocusWin;
+    if (pWin)
     {
-        while( pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent )
+        while (pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent)
             pWin = pWin->mpWindowImpl->mpParent;
 
         // check for corrupted window hierarchy, #122232#, may be we now crash somewhere else
-        if( !pWin->mpWindowImpl )
+        if (!pWin->mpWindowImpl)
         {
             OSL_FAIL( "Window hierarchy corrupted!" );
             pSVData->maWinData.mpFocusWin = nullptr;   // avoid further access
             return nullptr;
         }
 
-        if( (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0 )
+        if ((pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0)
         {
             return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
         }
     }
 
     // last active application frame
-    if( nullptr != (pWin = pSVData->maWinData.mpActiveApplicationFrame) )
+    pWin = pSVData->maWinData.mpActiveApplicationFrame;
+    if (pWin)
     {
         return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
     }
-    else
+
+    // first visible top window (may be totally wrong....)
+    pWin = pSVData->maWinData.mpFirstFrame;
+    while (pWin)
     {
-        // first visible top window (may be totally wrong....)
-        pWin = pSVData->maWinData.mpFirstFrame;
-        while( pWin )
+        if( pWin->ImplGetWindow()->IsTopWindow() &&
+            pWin->mpWindowImpl->mbReallyVisible &&
+            (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0
+        )
         {
-            if( pWin->ImplGetWindow()->IsTopWindow() &&
-                pWin->mpWindowImpl->mbReallyVisible &&
-                (pWin->mpWindowImpl->mnStyle & WB_INTROWIN) == 0
-            )
-            {
-                while( pWin->mpWindowImpl->mpParent )
-                    pWin = pWin->mpWindowImpl->mpParent;
-                return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
-            }
-            pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
+            while( pWin->mpWindowImpl->mpParent )
+                pWin = pWin->mpWindowImpl->mpParent;
+            return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
         }
-        // use the desktop
-        return nullptr;
+        pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
     }
+
+    // use the desktop
+    return nullptr;
 }
 
 Application::DialogCancelMode Application::GetDialogCancelMode()


More information about the Libreoffice-commits mailing list