summaryrefslogtreecommitdiff
path: root/vcl/win/window/salframe.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-04-03 12:34:38 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-04-03 14:09:19 +0200
commitc31734d0e49a778cffb1fdc3cd04adb45270e1da (patch)
tree380fdfda71429a0e8c1ff1d71bbe59df9ce76760 /vcl/win/window/salframe.cxx
parentac8ee6e8f7f2de31e1dc496c1fab953e88e15bba (diff)
tdf#114316 vcl opengl windows: fix missing context menu in full-screen mode
Full-screen mode on Windows used to work by measuring the space needed by window caption (title) and borders, then positioning and sizing the window in a way, so that the caption and borders are not visible. This approach breaks at least in the OpenGL case where a large enough negative position results in rendering errors. Fix the problem by explicitly requesting the window to have no caption, so we render less outside the screen (30 pixels -> 8 pixels in my case), which makes the "exit fullscreen" toolbar appear, also the context menu is visible. Change-Id: I6cf2b9774b505d3887b958a6a018b5ae84bbe4bc Reviewed-on: https://gerrit.libreoffice.org/70191 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/win/window/salframe.cxx')
-rw-r--r--vcl/win/window/salframe.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 6ecec9c2938f..64d505de56ff 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -843,6 +843,7 @@ WinSalFrame::WinSalFrame()
mbBorder = false;
mbFixBorder = false;
mbSizeBorder = false;
+ mbFullScreenCaption = false;
mbFullScreen = false;
mbPresentation = false;
mbInShow = false;
@@ -1850,6 +1851,15 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
if ( !(GetWindowStyle( mhWnd ) & WS_VISIBLE) )
mnShowState = SW_SHOW;
+ // Save caption state.
+ mbFullScreenCaption = mbCaption;
+ if (mbCaption)
+ {
+ DWORD nStyle = GetWindowStyle(mhWnd);
+ SetWindowStyle(mhWnd, nStyle & ~WS_CAPTION);
+ mbCaption = false;
+ }
+
// set window to screen size
ImplSalFrameFullScreenPos( this, true );
}
@@ -1865,6 +1875,14 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
SetWindowExStyle( mhWnd, GetWindowExStyle( mhWnd ) | WS_EX_TOOLWINDOW );
mbFullScreenToolWin = false;
+ // Restore caption state.
+ if (mbFullScreenCaption)
+ {
+ DWORD nStyle = GetWindowStyle(mhWnd);
+ SetWindowStyle(mhWnd, nStyle | WS_CAPTION);
+ }
+ mbCaption = mbFullScreenCaption;
+
SetWindowPos( mhWnd, nullptr,
maFullScreenRect.left,
maFullScreenRect.top,