-
Notifications
You must be signed in to change notification settings - Fork 867
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
On Windows, Add HitTest
event
#2538
base: master
Are you sure you want to change the base?
Conversation
d394ccf
to
15d2e09
Compare
I have a general question of what is the use for this sort of API? From what I see right now it seems like the user shouldn't care if the X button was clicked, since they have no control over it anyway? Why could you know that the border was pressed or it's windows specific and you want to filter out the events? |
At |
My understanding of undecorated window handling wrt resizes is that you manually decide on them and resize with. So basically #2003.
I'd assume you mean tiling to regions? Not sure what it means otherwise. From my understanding tiling to edges should be done by the system compositor and not the window. If you don't want to resize past the monitor boundaries you can likely check that during resize, but I'm not sure how you're limited here on windows. |
Snap layout is a Windows 11 feature, see https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/apply-snap-layout-menu specifically win32 solution in How do I fix it section. The window manager does handle the snapping but the snap layout UI won't show unless you respond to |
Shouldn't winit do this under the hood without exposing the event to the user directly? |
The snap layout UI will automatically work for decorated window but when decorations is disabled, winit can't know where is the maximize button, maybe there is no custom maximize button at all. |
Can't you create windows specific api for that or it really requires an event? The application could tell winit where the button is or something like that. |
It is possible to add an api to let winit store the button coordinates and size and internally handle that but you'd miss out on free resize and drag handling unless |
Hi, I'm trying to replicate the behavior used by Electron with This is a pretty handy customization options used by many popular apps and would be amazing to have it implemented here. EDIT: seems like electron draws the buttons from scratch. But they still go over a EDIT2: found more reference code from a Tauri fork here |
Will this be merged ? undecorated window resizing seems to only be doable well though the hit test event ! |
We're in need of this as well, I've created a rebased version of this PR here: https://github.com/Traverse-Research/winit/tree/window-area-writer We'd like to see this merged to main as well, as we're drawing custom decorations. |
CHANGELOG.md
if knowledge of this change could be valuable to usersRef: #2413