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

Wayland menus #1844

Merged
merged 39 commits into from
Feb 18, 2024
Merged

Wayland menus #1844

merged 39 commits into from
Feb 18, 2024

Conversation

leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Feb 6, 2024

This removes the gala-daemon autostart and instead starts it as a wayland client on wayland or as a normal subprocess on x. It therefore also removes all the session stuff (not sure whether we have to do somewhere else something else too).

It spawns a transparent window that covers the whole display and makes it responsible for positioning the menus.
This is done in preparation for the wayland transition.

This currently fully works under X but doesn't work under wayland. The reason for that is that on wayland gtk always closes menus automatically/doesn't even spawn them if they are opened without an event. However this would/will be an easy fix with popovers but for now they can't be used as context menus because in gtk3 they always draw an arrow. So I would argue this doesn't block since positioning etc. on wayland works and there is no change in x behavior

Hide whitespaces might help for reviewing since some namespaces were changed to inline
Probably fixes #1826

@leolost2605
Copy link
Member Author

This currently fully works under X but doesn't work under wayland. The reason for that is that on wayland gtk always closes menus automatically/doesn't even spawn them if they are opened without an event. However this will be an easy fix with popovers but they can't be used as context menu in gtk3 because they always draw an arrow. So I would argue this doesn't block since positioning etc. on wayland works and there is no change in x behavior

@leolost2605 leolost2605 requested a review from a team February 8, 2024 23:34
@leolost2605 leolost2605 marked this pull request as ready for review February 9, 2024 00:03
Copy link
Member

@danirabbit danirabbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add the new BackgroundMenu and WindowMenu files to POTFILES :)

@danirabbit
Copy link
Member

afaict this works exactly the same on X11. My wayland session is crashing right now so couldn't test that 😅 Would love an ack from @tintou or @lenemter so we can move forward :)

Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it with multiple monitors (yet) but still it looks very good. I left some code suggestions, after fixing them I'll happily approve this branch :)

daemon/MenuDaemon.vala Outdated Show resolved Hide resolved
daemon/MenuDaemon.vala Outdated Show resolved Hide resolved
daemon/WindowMenu.vala Outdated Show resolved Hide resolved
daemon/BackgroundMenu.vala Outdated Show resolved Hide resolved
daemon/Main.vala Outdated Show resolved Hide resolved
data/gala-daemon.css Outdated Show resolved Hide resolved
src/DaemonManager.vala Outdated Show resolved Hide resolved
src/DaemonManager.vala Outdated Show resolved Hide resolved
src/DaemonManager.vala Outdated Show resolved Hide resolved
src/WindowManager.vala Outdated Show resolved Hide resolved
Copy link
Member

@lenemter lenemter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

There is one thing that bothers me, you can switch workspaces while the menu is open. We should probably close the menu or disable workspace switch while the menu is open. This should be fixed later.

@lenemter lenemter merged commit 351722c into master Feb 18, 2024
4 checks passed
@lenemter lenemter deleted the wayland-menus branch February 18, 2024 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Missing gala-daemon systemd service
3 participants