-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
[Client side decorations] Implement window drag handles. #80891
Conversation
Interesting! As this is marked as a draft, what is still left to work on? |
855e909
to
8a50347
Compare
@bruvzg Can you upload the project you used for testing? Thanks in advance 🙂 |
This looks amazing! It would be extremely useful with the Wayland backend as not all compositors have SSDs and we're relying on a third party library for CSDs with all the implication that brings. I know that this is WIP, but I notice that you're including a I'd be very interested giving some help if needed. |
Added test project to the first post.
For now, it's just a mover / resizer. I'm not sure if there is anything else necessary for the CSDs. I guess window min/max/close buttons, but the only platform specific about them is snap/display switch popup menu for the maximize button on macOS/Windows, and checking if how minimized/minimized states works with the borderless window. |
The only thing I'm not really sure about is how you plan to actually frame some pretty decoration. Will the decoration object be a parent of |
Is the framing of the decorations necessary for this PR? Or could it be a separate PR |
Currently, it's children of the Window. |
@bruvgz oh I see, so it's more of a sort of optional pretty thing one can add. Am I understanding correctly? For my use-case I'd prefer a default case but I'm aware that this is very annoying if not impossible with the way that windows are implemented (pretty much fancy viewports). |
1d44edd
to
4c70b67
Compare
So I tested this and that project a bit and there seems to be an issue with the resize bottom handles where they either stop working completely or stop working until you resize using a different handle. There is one thing I don't quite like, and it's that you can't tell if the region is actually being clicked on or if the mouse button is pressed while dragging or moving, which means you can't really implement double click maximise/restore for the custom titlebar(technically, you can use a janky method, since you can get a mouse movement event when releasing the mouse button on the titlebar. So you can setup two timers to detect two mouse movement events with a click mask of 0 within a certain timeframe, but not too fast as to accidentally trigger on the buggy double-input you sometimes get from a single mouse release). Edit: It seems that the window decorations do not appear to properly update their position if they are inside containers, which makes some more complex layouts difficult and/or impossible |
3edfade
to
c5311ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally on Windows 11 23H2 (rebased on top of master
0eadbdb), there's an issue:
I can see the mouse cursor changing when hovering one of the corners (the area outside the red triangle here):
However, left-clicking and dragging does nothing.
I also don't see a horizontal/vertical resize cursor appearing when hovering the window edges, only the diagonal resize cursors at the corners.
PS: The resize cursors appear even if Resizable is disabled in the Project Settings, which is strange.
Yes, I have noticed that after last rebase, something seems to change and resize handles only work if window have |
Based on #16512
Implements more features for godotengine/godot-proposals#4846
Adds support for adding custom native window move / resize handles.
Screen.Recording.2023-08-22.at.16.00.21.mov
Test Project: test.zip
Fixes godotengine/godot-proposals#11214
Fixes window moving lag issues on macOS.