vcl/inc/win/salframe.h | 1 + vcl/win/window/salframe.cxx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+)
New commits: commit 52a8d0c0f4d61a1caa54331a20703175b83a5fe6 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Wed Apr 3 12:34:38 2019 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Apr 5 09:50:20 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. (cherry picked from commit c31734d0e49a778cffb1fdc3cd04adb45270e1da) Change-Id: I6cf2b9774b505d3887b958a6a018b5ae84bbe4bc Reviewed-on: https://gerrit.libreoffice.org/70200 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h index bc1cec234b9a..ac780f0c4bd1 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 068e1a3a19d7..cf1cf6375e01 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -842,6 +842,7 @@ WinSalFrame::WinSalFrame() mbBorder = false; mbFixBorder = false; mbSizeBorder = false; + mbFullScreenCaption = false; mbFullScreen = false; mbPresentation = false; mbInShow = false; @@ -1849,6 +1850,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 ); } @@ -1864,6 +1874,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, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits