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

feat(GTK): show menu in context menu if titlebar is disabled #4864

Merged

Conversation

ariasmn
Copy link
Contributor

@ariasmn ariasmn commented Jan 9, 2025

This PR addresses #4732.

While @tristan957 suggested alternative approaches, this implementation provides a straightforward way to make the menu accessible when the window decoration is disabled. It follows patterns seen in other GTK apps for handling submenus, though not strictly in the context menu format truth be told.

If there’s a better way to approach this or further refinements needed, I’m happy to discuss and iterate. This has been a minor issue I’ve encountered personally, and I’d like to help improve the experience for others as well.

Small video of how it looks:

menu-titlebar-disabled.mp4

@mitchellh
Copy link
Contributor

This looks great to me and was exactly what I had in mind. I'll wait for a @jcollie or @tristan957 review. Even if we can improve this in some way later I think getting this in sooner than later would be good; its something a lot of users hit.

@jcollie
Copy link
Collaborator

jcollie commented Jan 9, 2025

This is fine as a quick fix. I have plans to make the menu/context menu more integrated but it may be the weekend before I can get enough time to implement it.

@tristan957
Copy link
Collaborator

I don't love it, but I also won't be using it.

@mitchellh
Copy link
Contributor

In the limited other software I've looked at where you can disable titlebars or decorations, this seems fairly idiomatic. It's also been the most common ask by Gnome-haters just behind SSD support (explicitly asking for menu bars in the context menu). We'll have to remember when SSD support is merged in to verify that we also enables the menu in the right click. I plan on taking over this PRs myself so I'll check into it.

@mitchellh mitchellh merged commit 12ce9f2 into ghostty-org:main Jan 9, 2025
24 checks passed
@mitchellh
Copy link
Contributor

(My above comment isn't to invalidate any other approaches, its just that I'm happy to have this in for now and we can discuss its merit when other options pop up -- pun intended!)

@ariasmn
Copy link
Contributor Author

ariasmn commented Jan 9, 2025

I agree with you all. This might not be the best approach, and there’s definitely room for improvement, but I’m glad I could contribute something (even as a quick fix) in the meantime.

Thank you all for your amazing work!

@tristan957
Copy link
Collaborator

tristan957 commented Jan 9, 2025

In the limited other software I've looked at where you can disable titlebars or decorations, this seems fairly idiomatic.

If that's the case, then so be it. I definitely think a GtkPopoverMenuBar with a GtkRevealer is a better solution, similar to what Firefox does if you hit the Alt key. You never have to leave the keyboard. Can you access this context menu only via keyboard?

@tristan957
Copy link
Collaborator

I’m glad I could contribute something (even as a quick fix) in the meantime.

Welcome to the club 🚀 🎆.

@github-actions github-actions bot added this to the 1.1.0 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants