diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-09-27 17:34:38 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-10-01 01:20:15 +0200 |
commit | cb9970400d0bbd73e508f25a67e1ad2c7dd28eb6 (patch) | |
tree | 9f71bb36d6eb300e560170e3bd014f946a7a18a5 /svx | |
parent | 8b053a3c88c2b3e203856dbd9dabca6c935b0bde (diff) |
Wayland: Make various popups work in the overflow toolbar
Were failing to show, with this warning:
Gdk-WARNING **: Tried to map a popup with a non-top most parent
Change-Id: Ib68b5fc9b3edb3d25a23b66397c13833a4d080ac
Reviewed-on: https://gerrit.libreoffice.org/42936
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'svx')
11 files changed, 24 insertions, 21 deletions
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index 2cda7a14cd82..b5e54801dde7 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -46,8 +46,8 @@ using namespace svx; -ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) - : SfxPopupWindow(nId, "ParaLineSpacingControl", "svx/ui/paralinespacingcontrol.ui") +ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId, vcl::Window* pParent) + : SfxPopupWindow(nId, pParent, "ParaLineSpacingControl", "svx/ui/paralinespacingcontrol.ui") { mpSpacing1Button = get<PushButton>("spacing_1"); mpSpacing115Button = get<PushButton>("spacing_115"); diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index e467392bf6a9..2816916002fe 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -30,7 +30,7 @@ namespace svx { class ParaLineSpacingControl : public SfxPopupWindow { public: - explicit ParaLineSpacingControl(sal_uInt16 nId); + explicit ParaLineSpacingControl(sal_uInt16 nId, vcl::Window* pParent); virtual ~ParaLineSpacingControl() override; virtual void dispose() override; diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx index d8c549f0d31f..4920c79c3b1d 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx @@ -39,7 +39,7 @@ ParaLineSpacingPopup::~ParaLineSpacingPopup() VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow() { - VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId()); + VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId(), &GetToolBox()); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx index f1b8ae5d45ff..e43c423fc694 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx @@ -39,8 +39,8 @@ namespace svx { -TextCharacterSpacingControl::TextCharacterSpacingControl(sal_uInt16 nId) - : SfxPopupWindow(nId, "TextCharacterSpacingControl", "svx/ui/textcharacterspacingcontrol.ui") +TextCharacterSpacingControl::TextCharacterSpacingControl(sal_uInt16 nId, vcl::Window* pParent) + : SfxPopupWindow(nId, pParent, "TextCharacterSpacingControl", "svx/ui/textcharacterspacingcontrol.ui") , mnId(nId) , mnCustomKern(0) , mnLastCus(SPACING_NOCUSTOM) diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx index 9035c71290ad..1008441ada24 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx +++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx @@ -34,7 +34,7 @@ namespace svx { class TextCharacterSpacingControl : public SfxPopupWindow { public: - explicit TextCharacterSpacingControl(sal_uInt16 nId); + explicit TextCharacterSpacingControl(sal_uInt16 nId, vcl::Window* pParent); virtual ~TextCharacterSpacingControl() override; virtual void dispose() override; diff --git a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx index 7ce654fe3009..cdf0f99b8bb9 100644 --- a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx +++ b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx @@ -38,7 +38,7 @@ TextCharacterSpacingPopup::~TextCharacterSpacingPopup() VclPtr<SfxPopupWindow> TextCharacterSpacingPopup::CreatePopupWindow() { - VclPtr<TextCharacterSpacingControl> pControl = VclPtr<TextCharacterSpacingControl>::Create(GetSlotId()); + VclPtr<TextCharacterSpacingControl> pControl = VclPtr<TextCharacterSpacingControl>::Create(GetSlotId(), &GetToolBox()); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx index aaf5f82d3dee..1e2870f80503 100644 --- a/svx/source/sidebar/text/TextUnderlineControl.cxx +++ b/svx/source/sidebar/text/TextUnderlineControl.cxx @@ -29,8 +29,8 @@ namespace svx { -TextUnderlineControl::TextUnderlineControl(sal_uInt16 nId) -: SfxPopupWindow(nId, "TextUnderlineControl", "svx/ui/textunderlinecontrol.ui") +TextUnderlineControl::TextUnderlineControl(sal_uInt16 nId, vcl::Window* pParent) +: SfxPopupWindow(nId, pParent, "TextUnderlineControl", "svx/ui/textunderlinecontrol.ui") { get(maNone, "none"); get(maSingle, "single"); diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx index db9cfe8bdcf2..ec1df4bbb696 100644 --- a/svx/source/sidebar/text/TextUnderlineControl.hxx +++ b/svx/source/sidebar/text/TextUnderlineControl.hxx @@ -31,7 +31,7 @@ namespace svx { class TextUnderlineControl : public SfxPopupWindow { public: - explicit TextUnderlineControl(sal_uInt16 nId); + explicit TextUnderlineControl(sal_uInt16 nId, vcl::Window* pParent); virtual ~TextUnderlineControl() override; virtual void dispose() override; diff --git a/svx/source/sidebar/text/TextUnderlinePopup.cxx b/svx/source/sidebar/text/TextUnderlinePopup.cxx index 5b2645f7234f..b55e2d4032a3 100644 --- a/svx/source/sidebar/text/TextUnderlinePopup.cxx +++ b/svx/source/sidebar/text/TextUnderlinePopup.cxx @@ -43,7 +43,7 @@ void TextUnderlinePopup::initialize( const css::uno::Sequence< css::uno::Any >& VclPtr<SfxPopupWindow> TextUnderlinePopup::CreatePopupWindow() { - VclPtr<TextUnderlineControl> pControl = VclPtr<TextUnderlineControl>::Create(GetSlotId()); + VclPtr<TextUnderlineControl> pControl = VclPtr<TextUnderlineControl>::Create(GetSlotId(), &GetToolBox()); pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus); SetPopupWindow(pControl); diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index ef22cab1e8e9..9a4cecdc7453 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -72,6 +72,7 @@ private: public: TableWindow( sal_uInt16 nSlotId, + vcl::Window* pParent, const OUString& rCmd, const OUString& rText, const Reference< XFrame >& rFrame ); @@ -100,9 +101,9 @@ IMPL_LINK_NOARG(TableWindow, SelectHdl, Button*, void) } -TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUString& rText, - const Reference< XFrame >& rFrame ) - : SfxPopupWindow( nSlotId, rFrame, WinBits( WB_STDPOPUP ) ) +TableWindow::TableWindow( sal_uInt16 nSlotId, vcl::Window* pParent, const OUString& rCmd, + const OUString& rText, const Reference< XFrame >& rFrame ) + : SfxPopupWindow( nSlotId, pParent, rFrame, WB_STDPOPUP ) , aTableButton( VclPtr<PushButton>::Create(this) ) , nCol( 0 ) , nLine( 0 ) @@ -393,7 +394,8 @@ private: void UpdateSize_Impl( long nNewCol ); public: - ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUString &rText, const Reference< XFrame >& rFrame ); + ColumnsWindow( sal_uInt16 nId, vcl::Window* pParent, const OUString& rCmd, + const OUString &rText, const Reference< XFrame >& rFrame ); void KeyInput( const KeyEvent& rKEvt ) override; virtual void MouseMove( const MouseEvent& rMEvt ) override; @@ -404,8 +406,9 @@ public: }; -ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUString& rText, const Reference< XFrame >& rFrame ) : - SfxPopupWindow( nId, rFrame, WB_STDPOPUP ), +ColumnsWindow::ColumnsWindow( sal_uInt16 nId, vcl::Window* pParent, const OUString& rCmd, + const OUString& rText, const Reference< XFrame >& rFrame ) : + SfxPopupWindow( nId, pParent, rFrame, WB_STDPOPUP ), bInitialKeyInput(true), m_bMod1(false), mxFrame(rFrame), @@ -687,7 +690,7 @@ VclPtr<SfxPopupWindow> SvxTableToolBoxControl::CreatePopupWindow() if ( bEnabled ) { ToolBox& rTbx = GetToolBox(); - VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); + VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), &GetToolBox(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); pWin->StartPopupMode( &rTbx, FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose ); SetPopupWindow( pWin ); return pWin; @@ -732,7 +735,7 @@ VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow() VclPtr<ColumnsWindow> pWin; if(bEnabled) { - pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); + pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), &GetToolBox(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), m_xFrame ); pWin->StartPopupMode( &GetToolBox(), FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoKeyClose ); SetPopupWindow( pWin ); diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index f8f87bdd279b..1f5df981716e 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -71,7 +71,7 @@ public: }; SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx) - : SfxPopupWindow(nSlotId, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui") + : SfxPopupWindow(nSlotId, &rTbx, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui") , rToolBox(rTbx) , bUserSel(false) , nTbxId(nId) |