diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-04 10:22:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-04 16:03:21 +0200 |
commit | 3ff4800fe400de916c97f587322104af06cc0879 (patch) | |
tree | 0e7b2d29b6998445da0cec98bd924e5178a4ef60 /vcl/unx | |
parent | 265e1305e4f9bf8a4897069a020c9c65e8047f58 (diff) |
weld SvInsertOleDlg
and
weld SfxInsertFloatingFrameDialog
and smuggle in the parent widget for the Gtk File dialog via
an XWindow interface
Change-Id: I971b3a0ffe661c9268115fd5d00bf8eee80e77b3
Reviewed-on: https://gerrit.libreoffice.org/52373
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 21 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 14 |
2 files changed, 27 insertions, 8 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 7437bf44cb2a..e499350b12b4 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1582,15 +1582,20 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu if (xParentWindow.is()) { - css::uno::Reference<css::awt::XSystemDependentWindowPeer> xSysDepWin(xParentWindow, css::uno::UNO_QUERY); - if (xSysDepWin.is()) + if (SalGtkXWindow* pGtkXWindow = dynamic_cast<SalGtkXWindow*>(xParentWindow.get())) + m_pParentWidget = pGtkXWindow->getWidget(); + else { - css::uno::Sequence<sal_Int8> aProcessIdent(16); - rtl_getGlobalProcessId(reinterpret_cast<sal_uInt8*>(aProcessIdent.getArray())); - aAny = xSysDepWin->getWindowHandle(aProcessIdent, css::lang::SystemDependent::SYSTEM_XWINDOW); - css::awt::SystemDependentXWindow tmp; - aAny >>= tmp; - m_pParentWidget = GetGtkSalData()->GetGtkDisplay()->findGtkWidgetForNativeHandle(tmp.WindowHandle); + css::uno::Reference<css::awt::XSystemDependentWindowPeer> xSysDepWin(xParentWindow, css::uno::UNO_QUERY); + if (xSysDepWin.is()) + { + css::uno::Sequence<sal_Int8> aProcessIdent(16); + rtl_getGlobalProcessId(reinterpret_cast<sal_uInt8*>(aProcessIdent.getArray())); + aAny = xSysDepWin->getWindowHandle(aProcessIdent, css::lang::SystemDependent::SYSTEM_XWINDOW); + css::awt::SystemDependentXWindow tmp; + aAny >>= tmp; + m_pParentWidget = GetGtkSalData()->GetGtkDisplay()->findGtkWidgetForNativeHandle(tmp.WindowHandle); + } } } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index ebe1e226b723..916fda03ff74 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1577,6 +1577,7 @@ class GtkInstanceWindow : public GtkInstanceContainer, public virtual weld::Wind { private: GtkWindow* m_pWindow; + rtl::Reference<SalGtkXWindow> m_xWindow; //uno api static void help_pressed(GtkAccelGroup*, GObject*, guint, GdkModifierType, gpointer widget) { @@ -1608,6 +1609,13 @@ public: return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); } + virtual css::uno::Reference<css::awt::XWindow> GetXWindow() override + { + if (!m_xWindow.is()) + m_xWindow.set(new SalGtkXWindow(m_pWidget)); + return css::uno::Reference<css::awt::XWindow>(m_xWindow.get()); + } + virtual void set_busy_cursor(bool bBusy) override { gtk_widget_realize(m_pWidget); @@ -1618,6 +1626,12 @@ public: if (pCursor) g_object_unref(pCursor); } + + virtual ~GtkInstanceWindow() override + { + if (m_xWindow.is()) + m_xWindow->clear(); + } }; namespace |