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

Improve frameless window on windows #1324

Merged
merged 1 commit into from
Dec 1, 2020
Merged

Improve frameless window on windows #1324

merged 1 commit into from
Dec 1, 2020

Conversation

rhzk
Copy link
Collaborator

@rhzk rhzk commented Oct 16, 2020

Some changes to the frameless window on windows, reducing the resize artifacts and the behavior is more simular to electron.
Added a wrapper function for GetSystemMetric since it ended up being called a lot

@rhzk rhzk changed the title Improvements to frameless window on windows Improve frameless window on windows Oct 16, 2020
@rhzk rhzk marked this pull request as ready for review November 11, 2020 12:16
@cmyr
Copy link
Member

cmyr commented Nov 16, 2020

Played around with this a bit in a VM and wasn't able to really see any visual difference with master, but I'm also not very sure what I should be looking for. Is there anything in particular I should do to test this?

@rhzk
Copy link
Collaborator Author

rhzk commented Nov 17, 2020

The difference here is tiny.
The master version have 3 colored edges on left right and bottom side (something that was not visible to me originally until i played around with theme/effects settings in windows) this gets rid of those weird edges.

The other thing is resizing, and there is a few different things here: (This could potentially be different on other systems?)

Using PresentStrategy::Sequential mode with present_after = 1, ie waiting for vblank removed all resize artifacts with titlebar visible / normal mode, and made resizing seem a lot less "jiggly" in borderless mode.

In borderless mode the best option might actually be to use PresentStrategy::Flip and call handler.prepare_paint() inside WM_SIZE after the handler.size() call, atleast that gave very nice results on my system. I could update the PR to use this mode in borderless, unless there is some reason we want to avoid using Flip and/or not call prepare_paint() in WM_SIZE ?

I tried to make some recordings to show the resizing differences but the recording software was not good at capturing it, I might try some different software later

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really just not up on the windows side enough to offer much useful feedback. Given that, and given that I don't see any actual regressions when playing around, I'm inclined to defer to you.

@cmyr
Copy link
Member

cmyr commented Nov 24, 2020

@rhzk I've invited you as a collaborator on the druid repo, so feel free to merge your own approved PRs and also to provide approving reviews of others' PRs in circumstances where you feel comfortable doing so. :)

@rhzk
Copy link
Collaborator Author

rhzk commented Nov 25, 2020

Thanks for the invite @cmyr. I will let this PR simmer a bit more, just in case I might realize a better or simpler way to do something or something I missed.

@cmyr
Copy link
Member

cmyr commented Nov 25, 2020

sounds good!

@richard-uk1
Copy link
Collaborator

@cmyr @rhzk I would suggest merging this, because we won't get any data on its effects until then, and we can always reverse it out later if there are problems.

@rhzk rhzk merged commit a06469e into linebender:master Dec 1, 2020
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

Successfully merging this pull request may close these issues.

3 participants