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

Simplify borderless code and improve resizing behavior and style #367

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

alektron
Copy link

@alektron alektron commented Nov 27, 2024

This pull request simplifies the code in the WM_NCCALCSIZE and WM_NCHITTEST messages.
Not only is it simpler, it also does more by doing less.

  • Window drop shadows shows up properly
  • Resize areas extend out over the window client area instead of into it. This more closely matches the behavior of native Windows apps like Windows explorer (though many third party apps tend to struggle with this as well). An exception is the top resize which extends into the client area. This also matches the behavior of e.g. Windows Explorer

Note that while I did not do any changes in that regard, in my experience calls like DwmExtendFrameIntoClientArea are not necessary either. However I am not 100% certain about it and it does not seem to do any harm.

Windows API for borderless is a truly finicky thing to get right and every little change to get some better behavior out of it tends to break things somewhere else. So I can not guarantee that this has no issues but I've been using a slight variation of this code for quite a while now and did not have any issues.

The following clip is demonstrating the resizing behavior and drop shadows (or lack thereof) of the before (left) and after (right):

2024-11-27.01-11-28.mp4

@ryanfleury ryanfleury merged commit 0c86580 into EpicGamesExt:dev Dec 1, 2024
@ryanfleury
Copy link
Collaborator

Thanks for looking into this, checked it out on my end and it looks good.

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.

2 participants