aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-05-28 00:14:22 +1000
committerGitHub <noreply@github.com>2018-05-28 00:14:22 +1000
commit8fda41dab52656c7c4a0db9a835ae57cea994538 (patch)
tree2b0c481616cd738e0f6ca92be9594eec7707799b /sway/tree/view.c
parent569f4e0e4c75562c38848ea0bbaeb3b2f230b1a9 (diff)
parentde32b6d52ef8cf7d477fba23f42ca054155add56 (diff)
Merge branch 'master' into cmd-swap
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 812d7740..d91182ed 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -107,7 +107,7 @@ uint32_t view_get_window_type(struct sway_view *view) {
return 0;
}
-const char *view_get_type(struct sway_view *view) {
+const char *view_get_shell(struct sway_view *view) {
switch(view->type) {
case SWAY_VIEW_XDG_SHELL_V6:
return "xdg_shell_v6";
@@ -654,10 +654,12 @@ static size_t parse_title_format(struct sway_view *view, char *buffer) {
return title ? strlen(title) : 0;
}
const char *title = view_get_title(view);
+ const char *app_id = view_get_app_id(view);
const char *class = view_get_class(view);
const char *instance = view_get_instance(view);
- const char *shell = view_get_type(view);
+ const char *shell = view_get_shell(view);
size_t title_len = title ? strlen(title) : 0;
+ size_t app_id_len = app_id ? strlen(app_id) : 0;
size_t class_len = class ? strlen(class) : 0;
size_t instance_len = instance ? strlen(instance) : 0;
size_t shell_len = shell ? strlen(shell) : 0;
@@ -675,6 +677,10 @@ static size_t parse_title_format(struct sway_view *view, char *buffer) {
lenient_strcat(buffer, title);
len += title_len;
format += 6;
+ } else if (strncmp(next, "%app_id", 7) == 0) {
+ lenient_strcat(buffer, app_id);
+ len += app_id_len;
+ format += 7;
} else if (strncmp(next, "%class", 6) == 0) {
lenient_strcat(buffer, class);
len += class_len;