summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-06-12 07:48:09 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2022-06-14 13:28:36 +0200
commitec1019f2dac25d8e3d114553ff26eba21275f649 (patch)
tree911b36a51fc257c2597f18046cb5efe302bb0b66 /vcl/unx
parentf004c9fd176b42435cfde8dbe6ccee55cbce40d2 (diff)
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 <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/window/salframe.cxx19
-rw-r--r--vcl/unx/gtk3/gtkframe.cxx6
2 files changed, 8 insertions, 17 deletions
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));