Make i3bar aware of the new floating_hidden attribute
Patch status: needinfo
Patch by Fabián Ezequiel Gallina
To apply this patch, use:
curl http://cr.i3wm.org/patch/67/raw.patch | git am
b/i3bar/include/workspaces.h
14 |
@@ -32,6 +32,7 @@ void free_workspaces(void); |
15 |
|
16 |
struct i3_ws { |
17 |
int num; /* The internal number of the ws */ |
18 |
+ bool floating_hidden; /* If floating windows are hidden */ |
19 |
i3String *name; /* The name of the ws */ |
20 |
int name_width; /* The rendered width of the name */ |
21 |
bool visible; /* If the ws is currently visible on an output */ |
b/i3bar/src/workspaces.c
26 |
@@ -25,12 +25,18 @@ struct workspaces_json_params { |
27 |
}; |
28 |
|
29 |
/* |
30 |
- * Parse a boolean value (visible, focused, urgent) |
31 |
+ * Parse a boolean value (floating_hidden, visible, focused, urgent) |
32 |
* |
33 |
*/ |
34 |
static int workspaces_boolean_cb(void *params_, int val) { |
35 |
struct workspaces_json_params *params = (struct workspaces_json_params*) params_; |
36 |
|
37 |
+ if (!strcmp(params->cur_key, "floating_hidden")) { |
38 |
+ params->workspaces_walk->floating_hidden = val; |
39 |
+ FREE(params->cur_key); |
40 |
+ return 1; |
41 |
+ } |
42 |
+ |
43 |
if (!strcmp(params->cur_key, "visible")) { |
44 |
params->workspaces_walk->visible = val; |
45 |
FREE(params->cur_key); |
46 |
@@ -162,6 +168,7 @@ static int workspaces_start_map_cb(void *params_) { |
47 |
if (params->cur_key == NULL) { |
48 |
new_workspace = smalloc(sizeof(i3_ws)); |
49 |
new_workspace->num = -1; |
50 |
+ new_workspace->floating_hidden = 0; |
51 |
new_workspace->name = NULL; |
52 |
new_workspace->visible = 0; |
53 |
new_workspace->focused = 0; |