cui/source/options/treeopt.cxx |    9 +++++++++
 vcl/unx/gtk3/gtk3gtkinst.cxx   |    5 +++--
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit eb4806aaf3ec63ba9260a57315cc2ee442150e12
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Jul 2 10:54:52 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Jul 2 17:54:36 2020 +0200

    focus grabbed to options extension page when browsing options
    
    Window::Show grabs focus to the window if its a system window by default
    
    and XWindow::set_visible calls Show with default args
    
    Change-Id: Ief3b44068b867fe22f829de5d9722832692a35fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97681
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 2d6b104e1d9b..0e63a774d394 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -2044,6 +2044,15 @@ void ExtensionsTabPage::Show()
 {
     if (!m_xPageParent.is())
         return;
+
+    VclPtr<vcl::Window> xPageParent = VCLUnoHelper::GetWindow(m_xPageParent);
+    if (xPageParent)
+    {
+        // NoActivate otherwise setVisible will call Window::Show which will 
grab
+        // focus to the page by default
+        xPageParent->Show(true, ShowFlags::NoActivate);
+    }
+
     m_xPageParent->setVisible(true);
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 2eb237ef5009..e4449b121e41 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3670,7 +3670,8 @@ public:
         gtk_widget_set_can_focus(pWindow, true);
         g_object_unref(pWindow);
 
-        xEmbedWindow->Show();
+        // NoActivate otherwise Show grab focus to this widget
+        xEmbedWindow->Show(true, ShowFlags::NoActivate);
         css::uno::Reference<css::awt::XWindow> 
xWindow(xEmbedWindow->GetComponentInterface(), css::uno::UNO_QUERY);
         return xWindow;
     }
@@ -15742,7 +15743,7 @@ weld::Builder* 
GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUS
     SystemWindowData winData = {};
     winData.bClipUsingNativeWidget = true;
     auto xEmbedWindow = VclPtr<SystemChildWindow>::Create(pParent, 0, 
&winData, false);
-    xEmbedWindow->Show();
+    xEmbedWindow->Show(true, ShowFlags::NoActivate);
     xEmbedWindow->set_expand(true);
 
     const SystemEnvData* pEnvData = xEmbedWindow->GetSystemData();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to