-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Expose sandbox properties via IPC JSON, criteria, title format #8521
base: master
Are you sure you want to change the base?
Conversation
270600d
to
f4af2ca
Compare
static const struct wlr_security_context_v1_state *security_context_from_view( | ||
struct sway_view *view) { | ||
const struct wl_client *client = | ||
wl_resource_get_client(view->surface->resource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this has nothing xdg-shell specific - do we really need to get through the view->impl
abstraction, or can we just put this logic in generic view code?
@@ -602,6 +602,18 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object | |||
json_object_object_add(object, "inhibit_idle", | |||
json_object_new_boolean(view_inhibit_idle(c->view))); | |||
|
|||
const char *sandbox_engine = view_get_sandbox_engine(c->view); | |||
json_object_object_add(object, "sandbox_engine", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we should be adding these new props to the IPC man page as well.
If the value is \_\_focused\_\_, then the sandbox engine must be the same as | ||
that of the currently focused window. | ||
|
||
*sandbox_app_id* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kind of wondering whether we should expose this, or whether we should always prefer the sandbox-provided app ID over the one provided by the sandboxed client.
(IIRC GNOME allows org.libreoffice.Writer
if the sandbox app ID is org.libreoffice
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the whole this looks good to me, added a few comments!
(Thanks for rebasing on top of my criteria changes!)
Rebase and update of #7187.
Add sandbox properties to IPC JSON, criteria, and title format:
sandbox_engine
sandbox_app_id
sandbox_instance_id
These properties may be set by sandbox engines (e.g.
flatpak
) via the security context protocol: https://wayland.app/protocols/security-context-v1.Example Usage
Prepend sandbox properties to window title when sandbox engine is set:
Testing
Launch an app via
flatpak
:Observe JSON layout tree via
swaymsg -r -t get_tree
:Observe pretty layout tree via
swaymsg -p -t get_tree
:Observe window title when configured as shown above: