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

No window snapping without decorations on Windows #1548

Open
chrisduerr opened this issue Apr 26, 2020 · 3 comments
Open

No window snapping without decorations on Windows #1548

chrisduerr opened this issue Apr 26, 2020 · 3 comments

Comments

@chrisduerr
Copy link
Contributor

It seems like window snapping does not work on Windows when decorations are disabled. This was tested using the Windows shortcuts, since the decorations aren't available to drag them of course.

This was originally reported to Alacritty in alacritty/alacritty#3602.

@vovw
Copy link

vovw commented Mar 17, 2021

Did anyone find a solution for this ?

@amrbashir
Copy link
Contributor

amrbashir commented Mar 19, 2021

Also maximizing the window fills the whole monitor and doesn't account for the taskbar.

A solution for these issues can be found in this repo it is written in c++.

  1. Snapping needs WS_SIZEBOX or WS_THICKFRAME and WS_MAXIMIZEBOX and return 0 in WM_NCCALCSIZE window message.
    https://github.com/melak47/BorderlessWindow/blob/3b6978d88c0eef47f79c0ac125ec154bf701375c/BorderlessWindow/src/BorderlessWindow.cpp#L20

  2. Maximize issue can be fixed with adjusting the client rect when WM_NCCALCSIZE window message is fired:
    https://github.com/melak47/BorderlessWindow/blob/3b6978d88c0eef47f79c0ac125ec154bf701375c/BorderlessWindow/src/BorderlessWindow.cpp#L157-L164

    https://github.com/melak47/BorderlessWindow/blob/3b6978d88c0eef47f79c0ac125ec154bf701375c/BorderlessWindow/src/BorderlessWindow.cpp#L37-L56

@vovw
Copy link

vovw commented Mar 20, 2021

Oh thx would surely help :)

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

Successfully merging a pull request may close this issue.

4 participants