include/tools/wintypes.hxx | 2 -- include/vcl/svapp.hxx | 2 +- vcl/inc/svdata.hxx | 4 ++-- vcl/source/app/svapp.cxx | 4 ++-- vcl/source/app/svdata.cxx | 8 ++++---- vcl/source/gdi/virdev.cxx | 2 +- vcl/source/window/brdwin.cxx | 2 +- vcl/source/window/window.cxx | 6 +++++- 8 files changed, 16 insertions(+), 14 deletions(-)
New commits: commit 238b6cf0ff0d66d57bea9e8dc38d93caf4563124 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Sep 23 10:21:42 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Sep 23 13:02:34 2021 +0200 WB_DEFAULTWIN should be sufficient to flag that no icon is required Change-Id: Ibb5d8331d5d47e2b5c163c2797b2e7b5cee4b285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122517 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 1bc51788a572..fcccd9a0d0fa 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -229,8 +229,6 @@ WinBits const WB_NOINITIALSELECTION = SAL_CONST_INT64(0x001000000000); WinBits const WB_HIDESELECTION = SAL_CONST_INT64(0x002000000000); // DO NOT USE: 0x008000000000, that's WB_SYSTEMCHILDWINDOW -// tdf#144624: special bit used to skip assigning icon to virtual window -WinBits const WB_NOICON = SAL_CONST_INT64(0x200000000000); enum class WindowAlign { Left, Top, Right, Bottom }; diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index e7b3c3b08433..519aad8bb27b 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -824,7 +824,7 @@ public: @see GetFocusWindow */ - static OutputDevice* GetDefaultDevice(bool bUseIcon = true); + static OutputDevice* GetDefaultDevice(); /** Get the first top-level window of the application. diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index cadc35c1c067..d428b5b301a0 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -428,8 +428,8 @@ css::uno::Reference<css::i18n::XCharacterClassification> const& ImplGetCharClass void ImplDeInitSVData(); VCL_PLUGIN_PUBLIC basegfx::SystemDependentDataManager& ImplGetSystemDependentDataManager(); -VCL_PLUGIN_PUBLIC vcl::Window* ImplGetDefaultWindow(bool bUseIcon = true); -vcl::Window* ImplGetDefaultContextWindow(bool bUseIcon = true); +VCL_PLUGIN_PUBLIC vcl::Window* ImplGetDefaultWindow(); +vcl::Window* ImplGetDefaultContextWindow(); const std::locale& ImplGetResLocale(); VCL_PLUGIN_PUBLIC OUString VclResId(TranslateId sContextAndId); DockingManager* ImplGetDockingManager(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 515c97ff93ba..66c030dd5501 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1066,9 +1066,9 @@ vcl::Window* Application::GetFocusWindow() return ImplGetSVData()->mpWinData->mpFocusWin; } -OutputDevice* Application::GetDefaultDevice(bool bUseIcon) +OutputDevice* Application::GetDefaultDevice() { - return ImplGetDefaultWindow(bUseIcon)->GetOutDev(); + return ImplGetDefaultWindow()->GetOutDev(); } vcl::Window* Application::GetFirstTopLevelWindow() diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index c8b0c150297a..f91e1fe67fa9 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -206,17 +206,17 @@ basegfx::SystemDependentDataManager& ImplGetSystemDependentDataManager() } /// Returns either the application window, or the default GL context window -vcl::Window* ImplGetDefaultWindow(bool bUseIcon) +vcl::Window* ImplGetDefaultWindow() { ImplSVData* pSVData = ImplGetSVData(); if (pSVData->maFrameData.mpAppWin) return pSVData->maFrameData.mpAppWin; else - return ImplGetDefaultContextWindow(bUseIcon); + return ImplGetDefaultContextWindow(); } /// returns the default window created to hold the persistent VCL GL context. -vcl::Window *ImplGetDefaultContextWindow(bool bUseIcon) +vcl::Window *ImplGetDefaultContextWindow() { ImplSVData* pSVData = ImplGetSVData(); @@ -231,7 +231,7 @@ vcl::Window *ImplGetDefaultContextWindow(bool bUseIcon) { SAL_INFO( "vcl", "ImplGetDefaultWindow(): No AppWindow" ); - pSVData->mpDefaultWin = VclPtr<WorkWindow>::Create( nullptr, bUseIcon ? WB_DEFAULTWIN : WB_DEFAULTWIN | WB_NOICON ); + pSVData->mpDefaultWin = VclPtr<WorkWindow>::Create(nullptr, WB_DEFAULTWIN); pSVData->mpDefaultWin->SetText( "VCL ImplGetDefaultWindow" ); } catch (const css::uno::Exception&) diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index c539f3d3dc2c..77f364aded4d 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -205,7 +205,7 @@ VirtualDevice::VirtualDevice(const OutputDevice* pCompDev, DeviceFormat eFormat, << ", " << static_cast<int>(eAlphaFormat) << ", " << static_cast<int>(eOutDevType) << " )" ); - ImplInitVirDev(pCompDev ? pCompDev : Application::GetDefaultDevice(false), 0, 0); + ImplInitVirDev(pCompDev ? pCompDev : Application::GetDefaultDevice(), 0, 0); } VirtualDevice::VirtualDevice(const SystemGraphicsData& rData, const Size &rSize, diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 7cd7bb4eaaf1..95d508ce3597 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -1499,7 +1499,7 @@ void ImplBorderWindow::ImplInit( vcl::Window* pParent, { // remove all unwanted WindowBits WinBits nOrgStyle = nStyle; - WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_POPUP | WB_NOICON); + WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_POPUP); if ( nTypeStyle & BorderWindowStyle::App ) nTestStyle |= WB_APP; nStyle &= nTestStyle; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index e6ed7b3cf8b2..32f3231622fb 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1032,7 +1032,11 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p break; } - if( nStyle & WB_NOICON ) + // 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;