Kaydet (Commit) c31734d0 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/70191Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst ac8ee6e8
...@@ -49,6 +49,7 @@ public: ...@@ -49,6 +49,7 @@ public:
int mnMaxHeight; // max. client height in pixeln int mnMaxHeight; // max. client height in pixeln
RECT maFullScreenRect; // fullscreen rect RECT maFullScreenRect; // fullscreen rect
int mnFullScreenShowState; // fullscreen restore show state int mnFullScreenShowState; // fullscreen restore show state
bool mbFullScreenCaption; // WS_CAPTION reset in full screen mode.
UINT mnInputLang; // current Input Language UINT mnInputLang; // current Input Language
UINT mnInputCodePage; // current Input CodePage UINT mnInputCodePage; // current Input CodePage
SalFrameStyleFlags mnStyle; // style SalFrameStyleFlags mnStyle; // style
......
...@@ -843,6 +843,7 @@ WinSalFrame::WinSalFrame() ...@@ -843,6 +843,7 @@ WinSalFrame::WinSalFrame()
mbBorder = false; mbBorder = false;
mbFixBorder = false; mbFixBorder = false;
mbSizeBorder = false; mbSizeBorder = false;
mbFullScreenCaption = false;
mbFullScreen = false; mbFullScreen = false;
mbPresentation = false; mbPresentation = false;
mbInShow = false; mbInShow = false;
...@@ -1850,6 +1851,15 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) ...@@ -1850,6 +1851,15 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
if ( !(GetWindowStyle( mhWnd ) & WS_VISIBLE) ) if ( !(GetWindowStyle( mhWnd ) & WS_VISIBLE) )
mnShowState = SW_SHOW; 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 // set window to screen size
ImplSalFrameFullScreenPos( this, true ); ImplSalFrameFullScreenPos( this, true );
} }
...@@ -1865,6 +1875,14 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) ...@@ -1865,6 +1875,14 @@ void WinSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
SetWindowExStyle( mhWnd, GetWindowExStyle( mhWnd ) | WS_EX_TOOLWINDOW ); SetWindowExStyle( mhWnd, GetWindowExStyle( mhWnd ) | WS_EX_TOOLWINDOW );
mbFullScreenToolWin = false; mbFullScreenToolWin = false;
// Restore caption state.
if (mbFullScreenCaption)
{
DWORD nStyle = GetWindowStyle(mhWnd);
SetWindowStyle(mhWnd, nStyle | WS_CAPTION);
}
mbCaption = mbFullScreenCaption;
SetWindowPos( mhWnd, nullptr, SetWindowPos( mhWnd, nullptr,
maFullScreenRect.left, maFullScreenRect.left,
maFullScreenRect.top, maFullScreenRect.top,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment