aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-20 09:26:46 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-21 20:16:56 +1000
commit4672cb7ccfcba0c628e4f04cc1abcad7d769bb3d (patch)
treeec10bb7d3b518df337f846e4575f0aae06997029 /sway/tree/container.c
parentDon't track damage for views on inactive tabs (diff)
downloadsway-4672cb7ccfcba0c628e4f04cc1abcad7d769bb3d.tar.gz
sway-4672cb7ccfcba0c628e4f04cc1abcad7d769bb3d.tar.zst
sway-4672cb7ccfcba0c628e4f04cc1abcad7d769bb3d.zip
Use class or app_id in tree representation
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 5c1f42c2..5d88325f 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -784,23 +784,32 @@ static size_t concatenate_child_titles(struct sway_container *parent,
784 strcpy(buffer, "F["); 784 strcpy(buffer, "F[");
785 break; 785 break;
786 case L_NONE: 786 case L_NONE:
787 strcpy(buffer, "?["); 787 strcpy(buffer, "D[");
788 break; 788 break;
789 } 789 }
790 } 790 }
791 791
792 for (int i = 0; i < parent->children->length; ++i) { 792 for (int i = 0; i < parent->children->length; ++i) {
793 if (i != 0) { 793 if (i != 0) {
794 len += 2; 794 len += 1;
795 if (buffer) { 795 if (buffer) {
796 strcat(buffer, ", "); 796 strcat(buffer, " ");
797 } 797 }
798 } 798 }
799 struct sway_container *child = parent->children->items[i]; 799 struct sway_container *child = parent->children->items[i];
800 if (child->name) { 800 const char *identifier = NULL;
801 len += strlen(child->name); 801 if (child->type == C_VIEW) {
802 identifier = view_get_class(child->sway_view);
803 if (!identifier) {
804 identifier = view_get_app_id(child->sway_view);
805 }
806 } else {
807 identifier = child->name;
808 }
809 if (identifier) {
810 len += strlen(identifier);
802 if (buffer) { 811 if (buffer) {
803 strcat(buffer, child->name); 812 strcat(buffer, identifier);
804 } 813 }
805 } else { 814 } else {
806 len += 6; 815 len += 6;