pop-os / cosmic-comp

Compositor for the COSMIC desktop environment
GNU General Public License v3.0
476 stars 85 forks source link

Change how `COSMIC_ENABLE_WAYLAND_SECURITY`/`privileged` is handled #462

Closed ids1024 closed 4 months ago

ids1024 commented 4 months ago

Manually starting cosmic-panel was not working properly in release builds, because without cfg!(debug_assertions), the privileged flag wasn't sent on the panel, so it couldn't be propagated to the applets, which also fail the client_has_no_security_context() check.

I don't see a way to have both the cfg!(debug_assertions) check and COSMIC_ENABLE_WAYLAND_SECURITY. Now only the latter is used, and it determines the value of privileged for clients started normally. In the future, we could make the default value of COSMIC_ENABLE_WAYLAND_SECURITY depend on cfg!(debug_assertions) if desired. But it shouldn't be necessary to have debug_assertions to test clients, since that should work with normal release builds.

This also corrects the inconsistency that the cfg!(debug_assertions) check wasn't applied to the render-node-specific Wayland sockets.