vcl/inc/salframe.hxx | 2 -- vcl/inc/unx/salframe.h | 3 +++ vcl/unx/generic/window/salframe.cxx | 19 ++++++++----------- vcl/unx/gtk3/gtkframe.cxx | 6 ------ 4 files changed, 11 insertions(+), 19 deletions(-)
New commits: commit ec1019f2dac25d8e3d114553ff26eba21275f649 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Sun Jun 12 07:48:09 2022 +0200 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Tue Jun 14 13:28:36 2022 +0200 Make PARTIAL_FULLSCREEN a X11SalFrame bool SalFrameStyleFlags::PARTIAL_FULLSCREEN is just ever read in X11SalFrame, so there is no need to have it as a "global" flag. Just save it as a member boolean and drop it from gtk3. FWIW: consolidating all the booleans in X11SalFrame as a bitfield (AKA reorder the fields and declare them bool myvar : 1;) might be a nice easy hack. Change-Id: I6a94310d3b734ecfd083b520d613a076b1e7670a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135805 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index b7dcea63e64f..e6c111c1dab5 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -78,8 +78,6 @@ enum class SalFrameStyleFlags DIALOG = 0x00000080, // the window containing the intro bitmap, aka splashscreen 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 diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h index 7b804b0cc089..46d23f71aaf9 100644 --- a/vcl/inc/unx/salframe.h +++ b/vcl/inc/unx/salframe.h @@ -114,6 +114,7 @@ class X11SalFrame final : public SalFrame bool mbMaximizedVert; bool mbMaximizedHorz; bool mbFullScreen; + bool m_bIsPartialFullScreen; // icon id int mnIconID; @@ -168,6 +169,8 @@ public: void Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nScreen, SystemParentData const * pParentData, bool bUseGeometry = false ); + bool IsPartialFullScreen() const { return m_bIsPartialFullScreen; } + SalDisplay* GetDisplay() const { return pDisplay_; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index c2036167148f..bd0ffd7e0000 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -721,9 +721,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen } #define DECOFLAGS (SalFrameStyleFlags::MOVEABLE | SalFrameStyleFlags::SIZEABLE | SalFrameStyleFlags::CLOSEABLE) int nDecoFlags = WMAdaptor::decoration_All; - if( (nStyle_ & SalFrameStyleFlags::PARTIAL_FULLSCREEN) || - (nStyle_ & SalFrameStyleFlags::OWNERDRAWDECORATION) - ) + if (m_bIsPartialFullScreen || (nStyle_ & SalFrameStyleFlags::OWNERDRAWDECORATION)) nDecoFlags = 0; else if( (nStyle_ & DECOFLAGS ) != DECOFLAGS || (nStyle_ & SalFrameStyleFlags::TOOLWINDOW) ) { @@ -757,8 +755,7 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen eType = WMWindowType::Utility; if( nStyle_ & SalFrameStyleFlags::OWNERDRAWDECORATION ) eType = WMWindowType::Toolbar; - if( (nStyle_ & SalFrameStyleFlags::PARTIAL_FULLSCREEN) - && GetDisplay()->getWMAdaptor()->isLegacyPartialFullscreen() ) + if (m_bIsPartialFullScreen && GetDisplay()->getWMAdaptor()->isLegacyPartialFullscreen()) eType = WMWindowType::Dock; GetDisplay()->getWMAdaptor()-> @@ -767,11 +764,10 @@ void X11SalFrame::Init( SalFrameStyleFlags nSalFrameStyle, SalX11Screen nXScreen nDecoFlags, hPresentationWindow ? nullptr : mpParent ); - if( (nStyle_ & (SalFrameStyleFlags::DEFAULT | + if (!m_bIsPartialFullScreen && (nStyle_ & (SalFrameStyleFlags::DEFAULT | SalFrameStyleFlags::OWNERDRAWDECORATION| SalFrameStyleFlags::FLOAT | - SalFrameStyleFlags::INTRO | - SalFrameStyleFlags::PARTIAL_FULLSCREEN) ) + SalFrameStyleFlags::INTRO)) == SalFrameStyleFlags::DEFAULT ) pDisplay_->getWMAdaptor()->maximizeFrame( this ); @@ -844,6 +840,7 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, SalFrameStyleFlags nSalFrameStyle, mbMaximizedVert = false; mbMaximizedHorz = false; mbFullScreen = false; + m_bIsPartialFullScreen = false; mnIconID = SV_ICON_ID_OFFICE; @@ -1154,7 +1151,7 @@ void X11SalFrame::Show( bool bVisible, bool bNoActivate ) // even though transient frames should be kept above their parent // this does not necessarily hold true for DOCK type windows // so artificially set ABOVE and remove it again on hide - if( mpParent && (mpParent->nStyle_ & SalFrameStyleFlags::PARTIAL_FULLSCREEN ) && pDisplay_->getWMAdaptor()->isLegacyPartialFullscreen()) + if( mpParent && mpParent->m_bIsPartialFullScreen && pDisplay_->getWMAdaptor()->isLegacyPartialFullscreen()) pDisplay_->getWMAdaptor()->enableAlwaysOnTop( this, bVisible ); bMapped_ = bVisible; @@ -2082,7 +2079,7 @@ void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) aRect = tools::Rectangle( Point(0,0), GetDisplay()->GetScreenSize( m_nXScreen ) ); else aRect = GetDisplay()->GetXineramaScreens()[nScreen]; - nStyle_ |= SalFrameStyleFlags::PARTIAL_FULLSCREEN; + m_bIsPartialFullScreen = true; bool bVisible = bMapped_; if( bVisible ) Show( false ); @@ -2101,7 +2098,7 @@ void X11SalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nScreen ) else { mbFullScreen = false; - nStyle_ &= ~SalFrameStyleFlags::PARTIAL_FULLSCREEN; + m_bIsPartialFullScreen = false; bool bVisible = bMapped_; tools::Rectangle aRect = maRestorePosSize; maRestorePosSize = tools::Rectangle(); diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index c2430bb8c734..65fc1be35b10 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -2177,7 +2177,6 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect nY = aNewMonitor.y; nWidth = aNewMonitor.width; nHeight = aNewMonitor.height; - m_nStyle |= SalFrameStyleFlags::PARTIAL_FULLSCREEN; bResize = true; // #i110881# for the benefit of compiz set a max size here @@ -2192,7 +2191,6 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect nY = pSize->Top(); nWidth = pSize->GetWidth(); nHeight = pSize->GetHeight(); - m_nStyle &= ~SalFrameStyleFlags::PARTIAL_FULLSCREEN; bResize = true; } @@ -2266,8 +2264,6 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect gtk_window_set_resizable(GTK_WINDOW(m_pWindow), true); } - m_nStyle |= SalFrameStyleFlags::PARTIAL_FULLSCREEN; - if (pMenuBarContainerWidget) gtk_widget_hide(pMenuBarContainerWidget); if (bSpanMonitorsWhenFullscreen) @@ -2284,8 +2280,6 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect } else if (eType == SetType::UnFullscreen) { - m_nStyle &= ~SalFrameStyleFlags::PARTIAL_FULLSCREEN; - if (pMenuBarContainerWidget) gtk_widget_show(pMenuBarContainerWidget); gtk_window_unfullscreen(GTK_WINDOW(m_pWindow));