-
Notifications
You must be signed in to change notification settings - Fork 616
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
gtk: rework Windows and menus #4952
base: main
Are you sure you want to change the base?
Conversation
6187ca0
to
dfdb19a
Compare
I don't agree with the premise of this PR. I think we should continue to follow patterns established by other GTK/GNOME apps. "About Ghostty" is not useful in a context menu. |
It is if you have Leaving |
Imo, this is not a good solution for that problem. We should instead use a GtkPopoverMenuBar for SSD people, which can be toggled in a similar way to Firefox. |
dfdb19a
to
164349c
Compare
22f6eb4
to
0de2748
Compare
a201b78
to
66e73c8
Compare
Compositors can actually tell us whether they want to use CSD or SSD! (Ignore the context menu changes — they will most likely be unified after #4952 anyway)
66e73c8
to
27057eb
Compare
There is a lot I like in this PR, but there are some fundamental things I don't really like and want more discussion on. Things I like:
Things I'm indifferent about (don't care either way):
Things I don't like:
If we can discuss or address the "don't like" list then I'd be happy to head towards merging this. |
27057eb
to
05c2b88
Compare
OK, I think that I've addressed all of the feedback so far. "Top bar" was an invention of mine because I couldn't think of anything else, renamed to just "menubar". The context menu is slimmed down. I've also added compile-time checks of I don't like the idea of embedding the hamburger menu in the context menu, as there's a lot of duplication. It would be much easier to have section(s) of the context menu that get show/hidden based on the state of the titlebar. Not sure what is really "needed" but IMHO that can be bikeshedded later. Since the menus are declared as XML rather than code it's pretty easy to update them. |
1. Rework the GTK Window code to clean up the if/else spaghetti. This _should_ fix issues with older versions of Adwaita getting the titlebar and tab bar out of order. 2. Consolidate code for menus into one file and switch to using GtkPopupMenus built from GTK Builder XML files. This changes menus so that there is one per window and one per surface. This results in more memory usage, but more correct behavior. Previously context menus would pop up at the wrong location, due to not being attached to the correct GTK widget. Using GTK Builder XML files reduces the amount of code to create the menus and will make future changes to the menu structure easier. 3. Add a "top menu" that can be shown/hidden with a keybind action. This will be useful for people that use SSD and thus don't have the hamburger menu from the title bar.
1. "top menu" => "menubar" 2. Slimmed down context menu. 3. More robust compile time checks of GTK builder UI files.
fb9283f
to
4cfb088
Compare
should fix issues with older versions of Adwaita getting the
titlebar and tab bar out of order.
GtkPopupMenus built from GTK Builder XML files. This changes menus
so that there is one per window and one per surface. This results
in more memory usage, but more correct behavior. Previously context
menus would pop up at the wrong location, due to not being attached
to the correct GTK widget. Using GTK Builder XML files reduces the
amount of code to create the menus and will make future changes to
the menu structure easier.
This will be useful for people that use SSD and thus don't have the
hamburger menu from the title bar.