[Libreoffice-commits] core.git: vcl/inc vcl/win
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 3 12:09:43 UTC 2019
vcl/inc/win/salframe.h | 1 +
vcl/win/window/salframe.cxx | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
New commits:
commit c31734d0e49a778cffb1fdc3cd04adb45270e1da
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Apr 3 12:34:38 2019 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Apr 3 14:09:19 2019 +0200
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 at collabora.com>
Tested-by: Jenkins
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index c556794b64f7..8e94f384b523 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -49,6 +49,7 @@ public:
int mnMaxHeight; // max. client height in pixeln
RECT maFullScreenRect; // fullscreen rect
int mnFullScreenShowState; // fullscreen restore show state
+ bool mbFullScreenCaption; // WS_CAPTION reset in full screen mode.
UINT mnInputLang; // current Input Language
UINT mnInputCodePage; // current Input CodePage
SalFrameStyleFlags mnStyle; // style
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,
More information about the Libreoffice-commits
mailing list