summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksei Nikiforov <darktemplar@basealt.ru>2021-09-20 11:25:45 +0300
committerCaolán McNamara <caolanm@redhat.com>2021-09-23 12:39:09 +0200
commitd1e194baabc7d67a510cb363aa764b10e60881d2 (patch)
tree31cb706c5239bf2ae0fc0693671805c12f8016df
parent53bfea78bc218c84b7be5fe30e3146b7e90c8481 (diff)
tdf#144624 Prevent infinite recursion when loading SVG icon
When Generic/X11 VCL backend plugin loads SVG icon, it creates virtual device for rasterizing an SVG icon, which in turn tries to load an SVG icon, and thus infinite recursion happens. Change-Id: I7559b6255e6718e64ef4a6e7c79d597375e5823a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122344 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9b4478e62c712ef0f75c4a001e260dfdd6b3ca4c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122518
-rw-r--r--vcl/inc/salframe.hxx4
-rw-r--r--vcl/source/app/svdata.cxx2
-rw-r--r--vcl/source/window/window.cxx7
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
4 files changed, 12 insertions, 3 deletions
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 6525ab14b1c9..ac8840b437c7 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -80,6 +80,8 @@ enum class SalFrameStyleFlags
INTRO = 0x00000100,
// partial fullscreen: fullscreen on one monitor of a multimonitor display
PARTIAL_FULLSCREEN = 0x00800000,
+ // tdf#144624: don't set icon
+ NOICON = 0x01000000,
// system child window inside another SalFrame
SYSTEMCHILD = 0x08000000,
// plugged system child window
@@ -91,7 +93,7 @@ enum class SalFrameStyleFlags
};
namespace o3tl {
- template<> struct typed_flags<SalFrameStyleFlags> : is_typed_flags<SalFrameStyleFlags, 0x788001ff> {};
+ template<> struct typed_flags<SalFrameStyleFlags> : is_typed_flags<SalFrameStyleFlags, 0x798001ff> {};
};
// Extended frame style (sal equivalent to extended WinBits)
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index ba5fce26278a..1d1375b24d7b 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -232,7 +232,7 @@ vcl::Window *ImplGetDefaultContextWindow()
{
SAL_INFO( "vcl", "ImplGetDefaultWindow(): No AppWindow" );
- pSVData->mpDefaultWin = VclPtr<WorkWindow>::Create( nullptr, WB_DEFAULTWIN );
+ pSVData->mpDefaultWin = VclPtr<WorkWindow>::Create(nullptr, WB_DEFAULTWIN);
pSVData->mpDefaultWin->SetText( "VCL ImplGetDefaultWindow" );
}
catch (const css::uno::Exception&)
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e08e31763566..ae9df74d8faa 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1032,6 +1032,13 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
break;
}
+ // tdf#144624 for the DefaultWindow, which is never visible, don't
+ // create an icon for it so construction of a DefaultWindow cannot
+ // trigger creation of a VirtualDevice which itself requires a
+ // DefaultWindow to exist
+ if( nStyle & WB_DEFAULTWIN )
+ nFrameStyle |= SalFrameStyleFlags::NOICON;
+
SalFrame* pParentFrame = nullptr;
if ( pParent )
pParentFrame = pParent->mpWindowImpl->mpFrame;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 6e1c392706a9..5195dbde4103 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -561,7 +561,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen
if( IsOverrideRedirect() )
Attributes.override_redirect = True;
// default icon
- if( !(nStyle_ & SalFrameStyleFlags::INTRO) )
+ if( !(nStyle_ & SalFrameStyleFlags::INTRO) && !(nStyle_ & SalFrameStyleFlags::NOICON))
{
bool bOk=false;
try