-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Implement extend to title for Windows and Linux #96310
base: master
Are you sure you want to change the base?
Conversation
1971a79
to
495e0e1
Compare
495e0e1
to
d4f88c2
Compare
d4f88c2
to
f624e6a
Compare
I'm not sure if we want a separate flag for it, might be better to merge it with |
I've been working on the same feature for the past few days and have a few questions.
|
That's a interesting suggestion, I'll think about it. It should be easier to implement in the Project Manager or other windows in the future if the buttons are drawn directly in the Window class. I thought it could be interesting for games/app created with Godot to be able to create resizable without without the window min/max/close buttons. It could be added later. |
I'll look into it, bruvzg made the same suggestion.
I'm curious how you implemented it.
Indeed. |
FYI: https://learn.microsoft.com/en-us/windows/win32/dwm/customframe The screenshot below shows the project manager window run in windowed mode on Windows 10, notice the shadow around the window. |
bf73210
to
73016ce
Compare
I fixed the issue with the white border on top of the window on Windows 7/10. Thanks bughandler! If you want to work on that together @bughandler, I'm available in the Godot Contributors Chat: https://chat.godotengine.org |
@bruvzg I was working on using the already existing flag Should I create a control for that and add it to the scene? That would be the easiest way, but my concern is that these controls would be present in the scene tree at runtime for any project that uses The other alternative could be to manage the rendering manually, like in What’s the best approach? |
3c5830e
to
7b71dd0
Compare
7b71dd0
to
af45363
Compare
af45363
to
2db9ab6
Compare
43d65e9
to
87e4b31
Compare
@Calinou What do you think? These changed are not pushed yet, I still need to fix the full screen mode, the margin to put the menu in the corner, the border in splash screen of the Project Manager, and the distorting bug when any form of pillar/letterboxing is applied. |
72a26df
to
2b34729
Compare
Made some fixes/adjustments:
@Calinou This should fix everything you mentioned in your previous post, except for moving the main menu to the top-left corner. There are already some settings in the editor to specify spacing, and the editor uses these to define the global margin. I'm not sure I want to change that behavior in this PR?!? |
2b34729
to
b5a553a
Compare
Hi, I finally have a patch for Wayland. You can find it in my branch: https://github.com/Riteo/godot/commit/wayland-no-title-bar/ I had trouble adding drawing tablet support on sway so I left that out for now. Also keep note that if the backend detects and uses libdecor, our current "stopgap" decoration library, it won't be able to disable borders on natively decorated windows due to an upstream bug. #96825 would be useful in this case. |
Needs a rebase after #97333. |
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.
b5a553a
to
883a9b3
Compare
Rebased to fix conflict with master and fix a transparent line at the bottom when starting in extend to title mode and maximized on Windows. |
First, thanks for testing it! Second, that's weird ;) Can you share with me your Can you try restarting the editor after you move all the Another possibility could be a wrong settings in Also, do you have multiple monitors?? |
System info: The problem persist even on a fresh config (removed C:\Users[username]\AppData\Roaming\Godot folder). I have a monitor connected to my laptop right now, which seems to cause the issue: the editor becomes visible when I disconnect the monitor. |
Thanks a lot, that is very helpful, I'll look into it. |
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.
I was waiting for the implementation to settle in.
883a9b3
to
77b4852
Compare
77b4852
to
45b0a5a
Compare
Thanks for the review @Mickeon, I made the suggested modifications the best I can. |
45b0a5a
to
fdfc6d1
Compare
The project manager that extends to titles is not a good experience under Linux X11:
Maybe it should call the x11 start moving window and start resizing api, instead of directly setting the window position and size? This pr: 2024-10-21.09-45-46.mp4My experimental project: 2024-10-21.09-46-40.mp4 |
Vertical position offset of the close button. | ||
</theme_item> | ||
<theme_item name="maximize_h_offset" data_type="constant" type="int" default="36"> | ||
Horizontal position offset of the maximize/restore decoration button, when [member extend_to_title] is true and the button is rendered by Godot. |
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.
Many other descriptions in the PR would have to be adjusted as follows:
Horizontal position offset of the maximize/restore decoration button, when [member extend_to_title] is true and the button is rendered by Godot. | |
Horizontal position offset of the maximize/restore decoration button, when [member extend_to_title] is [code]true[/code] and the button is rendered by Godot. |
This pr's minimize button differs from the native minimize button: you need to click the taskbar icon twice to redisplay the window after minimizing, and it won't keep the window maximized, which is a bug of directly setting the window mode to 2024-12-20.02-14-28.mp4 |
At least for Linux it definitely better to do so, this will add Wayland support and is an improvement over manually moving window on X11. Windows code is OK as is, but can be replaced as well, for consistency. |
Though some Wayland environments (for example KDE) prefers to give titlebars themselves, so you need to give proper preference through xdg-decoration protocol (Also maybe make the default for server side titlebars for such environments if their such preference is detected) |
This PR implements the
EXTEND_TO_TITLE
flag for Windows and Linux X11. Implementing this flag allows Windows and Linux to use the editor without the default title bar. Additionally, it makes it possible to use this flag in any Godot project outside the editor.Since Windows and Linux don’t natively support this mode, it is "simulated" by providing a resizable borderless window with minimize, maximize, and close buttons rendered directly in the
Window
class. New properties were added to theWindow Theme
to define the button icons, positions, and styles.Here’s a little demo:
Windows:
godot.windows.editor.dev.x86_64_5zKbXLNLPu.mp4
Linux:
