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

Clarify zwlr_foreign_toplevel_handle_v1 vs. xdg_toplevel #20

Open
probonopd opened this issue Dec 30, 2023 · 6 comments
Open

Clarify zwlr_foreign_toplevel_handle_v1 vs. xdg_toplevel #20

probonopd opened this issue Dec 30, 2023 · 6 comments

Comments

@probonopd
Copy link
Owner

probonopd commented Dec 30, 2023

In X11, there is the concept of a "window" which can be referred to by its unique Window ID (wid).

On Wayland, there is zwlr_foreign_toplevel_handle_v1 and xdg_toplevel. Apparently the latter is for native Wayland applications whereas the former isn't.

Question: Can native Wayland applications use zwlr_foreign_toplevel_handle_v1 too? Or do we have to have provisions for windows created by native Wayland applications (using xdg_toplevel) and for windows not created by native Wayland applications (using zwlr_foreign_toplevel_handle_v1)?

@i509VCB
Copy link

i509VCB commented Dec 31, 2023

zwlr_foreign_toplevel_handle_v1 can refer to an xwayland, xdg toplevel or any window type that behaves like a toplevel.

There is a ext_foreign_toplevel_list protocol intended to succeeded the wlr protocol, just needs a new extension protocol to reach parity. The goal of that protocol is to act as an opaque handle to desktop-like windows from other processes.

@probonopd
Copy link
Owner Author

Thanks for the clarification @i509VCB. So would you say that we should be using zwlr_foreign_toplevel_handle_v1 instead of xdg_toplevel whenever we need to refer to windows regardless of whether they come from Wayland or X11 applications?

@myownfriend
Copy link

@probonopd for questions about the existing protocol, it might be better to ask them in the official repo. They'll be able to give you suggestions on what to do.

Anything beginning with zwlr is a wlroots-specific protocol, not an official Wayland protocol. ext_foreign_toplevel_list is an official Wayland protocol.

https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tree/main/staging/ext-foreign-toplevel-list?ref_type=heads

@i509VCB
Copy link

i509VCB commented Jan 1, 2024

Just to note I am the author of the ext protocol, so feel free to bug me with questions.

I'll get to probono's question when I get home, currently out for new years

@i509VCB
Copy link

i509VCB commented Jan 1, 2024

Thanks for the clarification @i509VCB. So would you say that we should be using zwlr_foreign_toplevel_handle_v1 instead of xdg_toplevel whenever we need to refer to windows regardless of whether they come from Wayland or X11 applications?

I'd say it depends on the context:

If the goal is to provide a function where the client only cares about it's own windows, then xdg_surface/xdg_toplevel work well here.

If the goal is to provide a function where some other client's windows might be involved, then ext_foreign_toplevel_handle_v1 would probably be what you'd want to use.

@probonopd
Copy link
Owner Author

probonopd commented Jan 1, 2024

That is very reasonable, thanks a lot @i509VCB. Happy New Year!

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

No branches or pull requests

3 participants