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(wayland): popup window #196

Open
wusyong opened this issue Oct 12, 2024 · 3 comments
Open

feat(wayland): popup window #196

wusyong opened this issue Oct 12, 2024 · 3 comments
Labels
E-very-complex Very difficult. Do not attempt without significant relevant experience and motivation. enhancement New feature or request

Comments

@wusyong
Copy link
Member

wusyong commented Oct 12, 2024

While we can use muda to create context menu, it requires GTK as dependency.
We want to go with more native approach so I'm researching smithay-client-toolkit at the moment.
According to wayland protocol, we need to get window's wl_surface and obtain xdg_surface for it.
This means we also needs to get the xdg_wm_base global, but smithay_client_toolkit doesn't seem to have anywhere to explain how to get this.
The rests steps are almost from the method of xdg_wm_base as well.

If we could get the wl_surface of the popup window, we can think about how to add it into our Window type. Hence, it will be able to become a webview and render the menu we want to display.

@wusyong wusyong added enhancement New feature or request E-very-complex Very difficult. Do not attempt without significant relevant experience and motivation. labels Oct 12, 2024
@wusyong
Copy link
Member Author

wusyong commented Oct 12, 2024

See also: Smithay/client-toolkit#471

@pewsheen
Copy link
Collaborator

Currently I can create an xdg_popup from smithay-client-toolkit
pewsheen/client-toolkit@373e637

But I'm unsure if I'm using it correctly, and it needs delegated seats to handle input as well.

I think the next step will be using it with Winit. But it seems that Winit has not re-exposed those Wayland states; we will figure it out in the following days.

@pewsheen
Copy link
Collaborator

Okay! I made a workable version that modified from Winit example
pewsheen/winit@73fad21

Unfortunately, it requires implementing some traits to the WinitState in the Winit crate. Hence, we may not be able to create the popup at the moment, or maybe someone else has ideas 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-very-complex Very difficult. Do not attempt without significant relevant experience and motivation. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants