Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical bar on secondary screen when window is maximized #54

Open
SimonBuxx opened this issue Mar 5, 2022 · 3 comments
Open

Vertical bar on secondary screen when window is maximized #54

SimonBuxx opened this issue Mar 5, 2022 · 3 comments

Comments

@SimonBuxx
Copy link

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.

@LochlanPerry-Scott
Copy link

LochlanPerry-Scott commented Oct 1, 2022

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.

@SimonBuxx
Copy link
Author

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.

@Harinlen
Copy link

Thanks for the patch, helps me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants