summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-22 22:05:00 +0100
committerLibravatar S. Christoffer Eliesen <christoffer@eliesen.no>2015-11-24 16:00:41 +0100
commit47c313fe3e8f66dafbebd4d00c143ac4a49c5c2d (patch)
treeb441ff0caf59e7a741858fa2c6ac7c076ae5e07a /sway
parentMerge pull request #248 from taiyu-len/master (diff)
downloadsway-47c313fe3e8f66dafbebd4d00c143ac4a49c5c2d.tar.gz
sway-47c313fe3e8f66dafbebd4d00c143ac4a49c5c2d.tar.zst
sway-47c313fe3e8f66dafbebd4d00c143ac4a49c5c2d.zip
container: Store class attribute for views.
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/container.c b/sway/container.c
index bbe2e7b0..5bf59c26 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -50,6 +50,9 @@ static void free_swayc(swayc_t *cont) {
50 if (cont->name) { 50 if (cont->name) {
51 free(cont->name); 51 free(cont->name);
52 } 52 }
53 if (cont->class) {
54 free(cont->class);
55 }
53 free(cont); 56 free(cont);
54} 57}
55 58
@@ -214,6 +217,8 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
214 // Setup values 217 // Setup values
215 view->handle = handle; 218 view->handle = handle;
216 view->name = title ? strdup(title) : NULL; 219 view->name = title ? strdup(title) : NULL;
220 const char *class = wlc_view_get_class(handle);
221 view->class = class ? strdup(class) : NULL;
217 view->visible = true; 222 view->visible = true;
218 view->is_focused = true; 223 view->is_focused = true;
219 // Setup geometry 224 // Setup geometry
@@ -246,6 +251,8 @@ swayc_t *new_floating_view(wlc_handle handle) {
246 // Setup values 251 // Setup values
247 view->handle = handle; 252 view->handle = handle;
248 view->name = title ? strdup(title) : NULL; 253 view->name = title ? strdup(title) : NULL;
254 const char *class = wlc_view_get_class(handle);
255 view->class = class ? strdup(class) : NULL;
249 view->visible = true; 256 view->visible = true;
250 257
251 // Set the geometry of the floating view 258 // Set the geometry of the floating view