aboutsummaryrefslogtreecommitdiff
path: root/sway/workspace.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-10 23:47:14 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-10 23:47:14 -0400
commitdd115cece3490a2d1791880cd45fae4b274a123a (patch)
tree43557d61373bbecf488e0940c1e55ef2abc50bee /sway/workspace.c
parente62e294366e634dbd584ea8fd2a9ed93aa81e356 (diff)
Prevent passing WM keys, improve multihead support
Diffstat (limited to 'sway/workspace.c')
-rw-r--r--sway/workspace.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sway/workspace.c b/sway/workspace.c
index 01779723..53675c03 100644
--- a/sway/workspace.c
+++ b/sway/workspace.c
@@ -9,10 +9,18 @@
swayc_t *active_workspace = NULL;
+int ws_num = 1;
+
char *workspace_next_name(void) {
- //TODO change this i guess. seems pretty bad
- char *name = malloc(sizeof("1"));
- return strcpy(name, "1");
+ int l = 1;
+ if (ws_num >= 10) {
+ l = 2;
+ } else if (ws_num >= 100) {
+ l = 3;
+ }
+ char *name = malloc(l + 1);
+ sprintf(name, "%d", ws_num++);
+ return name;
}
swayc_t *workspace_create(const char* name) {
@@ -45,7 +53,6 @@ bool workspace_destroy(swayc_t *workspace) {
sway_log(L_DEBUG, "Workspace: Destroying workspace '%s'", workspace->name);
free_swayc(workspace);
return true;
-
}
void set_mask(swayc_t *view, void *data) {