-
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?
Changes from all commits
b83a969
6272264
799d991
c4b834b
f4af2ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
sandbox_engine ? json_object_new_string(sandbox_engine) : NULL); | ||
|
||
const char *sandbox_app_id = view_get_sandbox_app_id(c->view); | ||
json_object_object_add(object, "sandbox_app_id", | ||
sandbox_app_id ? json_object_new_string(sandbox_app_id) : NULL); | ||
|
||
const char *sandbox_instance_id = view_get_sandbox_instance_id(c->view); | ||
json_object_object_add(object, "sandbox_instance_id", | ||
sandbox_instance_id ? json_object_new_string(sandbox_instance_id) : NULL); | ||
|
||
json_object *idle_inhibitors = json_object_new_object(); | ||
|
||
struct sway_idle_inhibitor_v1 *user_inhibitor = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,12 +372,29 @@ set|plus|minus|toggle <amount> | |
*title_format* <format> | ||
Sets the format of window titles. The following placeholders may be used: | ||
|
||
%title - The title supplied by the window ++ | ||
%app_id - The wayland app ID (applicable to wayland windows only) ++ | ||
%class - The X11 classname (applicable to xwayland windows only) ++ | ||
%instance - The X11 instance (applicable to xwayland windows only) ++ | ||
%shell - The protocol the window is using (typically xwayland or | ||
xdg_shell) | ||
*%title* | ||
The title supplied by the window | ||
|
||
*%app_id* | ||
The wayland app ID (applicable to wayland windows only) | ||
|
||
*%class* | ||
The X11 classname (applicable to xwayland windows only) | ||
|
||
*%instance* | ||
The X11 instance (applicable to xwayland windows only) | ||
|
||
*%shell* | ||
The protocol the window is using (typically xwayland or xdg_shell) | ||
|
||
*%sandbox_engine* | ||
The associated sandbox engine | ||
|
||
*%sandbox_app_id* | ||
The app ID provided by the associated sandbox engine | ||
|
||
*%sandbox_instance_id* | ||
The instance ID provided by the associated sandbox engine | ||
|
||
This command is typically used with *for_window* criteria. For example: | ||
|
||
|
@@ -1058,6 +1075,22 @@ The following attributes may be matched with: | |
expression. If the value is \_\_focused\_\_, then all the views on the | ||
currently focused workspace matches. | ||
|
||
*sandbox_engine* | ||
Compare against the associated sandbox engine. Can be a regular expression. | ||
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 commentThe 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 |
||
Compare against the app ID provided by the associated sandbox engine. Can be | ||
a regular expression. If the value is \_\_focused\_\_, then the sandbox app | ||
ID must be the same as that of the currently focused window. | ||
|
||
*sandbox_instance_id* | ||
Compare against the instance ID provided by the associated sandbox engine. | ||
Can be a regular expression. If the value is \_\_focused\_\_, then the | ||
sandbox instance ID must be the same as that of the currently focused | ||
window. | ||
|
||
# SEE ALSO | ||
|
||
*sway*(1) *sway-input*(5) *sway-output*(5) *sway-bar*(5) *sway-ipc*(7) |
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?