summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-02 10:54:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-02 17:54:36 +0200
commiteb4806aaf3ec63ba9260a57315cc2ee442150e12 (patch)
treec40fccb4a599b5268f62c11db1a9a3d830b879d0
parentedca1aa90ad1ec2f8959effc7198f227e3be91d4 (diff)
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 <caolanm@redhat.com>
-rw-r--r--cui/source/options/treeopt.cxx9
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx5
2 files changed, 12 insertions, 2 deletions
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();