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

zwlr_foreign_toplevel_handle_v1.app_id() does not respect xdg_toplevel.set_app_id() #3626

Open
AlanGriffiths opened this issue Oct 10, 2024 · 3 comments

Comments

@AlanGriffiths
Copy link
Contributor

Running the wlcs tests from within CLion I see:

WAYLAND_DEBUG=client cmake-build-debug/wlcs /home/alan/CLionProjects/mir/cmake-build-debug/lib/miral_wlcs_integration.so --gtest_filter=ForeignToplevelHandleTest.can_minimize_foreign  
...
[1105973.424]  -> [email protected]_app_id("fake.wlcs.app.id")
...
[1105974.183] [email protected]_id("clion_clion.desktop")

Running the same test from a console window:

WAYLAND_DEBUG=client cmake-build-debug/wlcs /home/alan/CLionProjects/mir/cmake-build-debug/lib/miral_wlcs_integration.so --gtest_filter=ForeignToplevelHandleTest.can_minimize_foreign  
...
[1267160.475]  -> [email protected]_app_id("fake.wlcs.app.id")
...
[1267160.901] [email protected]_id("fake.wlcs.app.id")

The latter is what I (and the wlcs code) expect.

I guess that the difference is that CLion is a classic snap (with an associated AppArmor profile). But if a client sets the app_id, what business do we have in overriding it? Especially with a .desktop file name?

@AlanGriffiths
Copy link
Contributor Author

A workaround is to prefix the wlcs command with aa-exec -p unconfined vis:

aa-exec -p unconfined cmake-build-debug/wlcs /home/alan/CLionProjects/mir/cmake-build-debug/lib/miral_wlcs_integration.so --gtest_filter=ForeignToplevelHandleTest.can_minimize_foreign

@AlanGriffiths
Copy link
Contributor Author

Especially with a .desktop file name?

That bit is likely #3608

@mattkae
Copy link
Contributor

mattkae commented Oct 11, 2024

The real issue here is that we're abusing the zwlr_foreign_toplevel_handle_v1.app_id() field, and we've known this from the start. Instead of just returning the app ID as you gave it to us, we instead try to resolve it to a value that is more useful when resolving desktop files on the client's side (e.g. the app armor profile).

So, even if the user has set an app_id, we instead use that to resolve a desktop file. Maybe we should just be introducing a new field here, but that is a design decisions that we'd have to make.

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

2 participants