Vertical bar on secondary screen when window is maximized
SimonBuxx opened this issue · 3 comments
When maximizing the window, my secondary screen displays a grey vertical bar of about ten pixels on the side towards the other screen.
This happens only with showMaximized(), not showFullscreen().
If someone knows about this issue or even has a solution, I would appreciate a hint. I'm using Windows 10, Version 21H1. One monitor is 1920x1080px, the other 1680x1050px so there is some scaling involved.
Howdy @SimonBuxx,
I too have stumbled across this issue.
I'm also using the same Windows Version and Monitor Aspect.
Initially it looks as though removing WS_CAPTION from the function '::SetWindowLong' fixed the original Vertical Bar issue however, it seems to have introduced further issues, as now a new boarder appears when full screened. (Thankfully this does not extend the one monitor).
But still not expected behaviour.
After browsing Window Styles in Winuser.h it seems that WS_CAPTION may be necessary.
(According to the Flag WS_OVERLAPPEDWINDOW, that is basically used when initializing the Resizable window)
So after another hour of testing a separate route I stumbled to an answer/workaround.
Inside of the CFramelessWindow, 'setResizable(bool)' function there is a bit of code at the end that sets a 'shadow margin'.
It seems that changing this value from:
const MARGINS shadow = { 1, 1, 1, 1 };
To:
const MARGINS shadow = { 10, 10, 10, 10 };
Works!
It looks as though there might be, at least, an 8px border around the Window, so setting the margin to anything above 8 seems to fix this issue, in my case anyway.
@Bringer-of-Light, It might be worth investigating into why this happens as it is bizarre behaviour.
I hope this can at least help with a work around until this can be sorted.
Hey @LochlanPerry-Scott,
thank you for sharing your findings!
I abandoned the idea of a custom window for my particular application because of this issue and other drawbacks. Even apps like Spotify or Discord seem to struggle with this, although it's better now on my new QHD monitors and maybe they also improved their software.
I'll definitely try out your fix, maybe I can finally switch to a custom window at one point.
Thanks for the patch, helps me a lot.