JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
gutter between master and slaves
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index e66ace8..e1ea9b4 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -1751,7 +1751,7 @@ kbspawn(const Arg *arg) {
 void
 spawn(const Arg *arg) {
        int tag = 0, i;
-       if(arg->v == termcmd) {
+       if(arg->v == termcmd || arg->v == runcmd) {
                for(i = 0; i < 32; ++i) {
                        if(selmon->tagset[selmon->seltags] & (1 << i)) {
                                tag = i;
@@ -1759,7 +1759,7 @@ spawn(const Arg *arg) {
                        }
                }
                WORKSPACE_NUMBER[17] = workspace_numbers_str[tag][0];
-               WORKSPACE_NUMBER[18] = workspace_numbers_str[tag][1];
+               WORKSPACE_NUMBER[18] = workspace_numbers_str[tag][1]; // 2nd digit or null
        }
        if(arg->v == dmenucmd)
                dmenumon[0] = '0' + selmon->num;
@@ -1823,6 +1823,7 @@ tile(Monitor *m) {
 
 #define TAB_HEIGHT 19
 #define TAB_PAD     7
+#define GUTTER_PX   8
 
 void
 jason_layout(Monitor *m) {
@@ -1858,7 +1859,7 @@ jason_layout(Monitor *m) {
        } else {
                mw = m->ww;
        }
-       right_width = m->ww - mw;
+       right_width = m->ww - mw - GUTTER_PX;
        tab_count = &(tab_counts[0]);
        tab_top = m->wy - (m->wh - (2 * (TAB_HEIGHT + TAB_PAD))) + TAB_HEIGHT;
        for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
@@ -1866,14 +1867,14 @@ jason_layout(Monitor *m) {
                        resize(c, m->wx, m->wy, mw, m->wh, False, 0);
                } else {
                        if (c == vis_slave) {
-                               resize(c, m->wx + mw, m->wy + TAB_HEIGHT + TAB_PAD, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base);
+                               resize(c, m->wx + mw + GUTTER_PX, m->wy + TAB_HEIGHT + TAB_PAD, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base);
                                tab_count = &(tab_counts[1]);
                                tab_top = m->wy + m->wh - TAB_HEIGHT;
                                cur_tab = 0;
                        } else {
                                // this function does not get called when focus changes
                                // resize(c, m->wx + m->ww, m->wy, m->ww - mw, m->wh, False);
-                               resize(c, m->wx + mw + right_width * cur_tab / (*tab_count), tab_top, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base);
+                               resize(c, m->wx + mw + GUTTER_PX + right_width * cur_tab / (*tab_count), tab_top, right_width, m->wh - 2 * (TAB_HEIGHT + TAB_PAD), False, base);
                                cur_tab += 1;
                        }
                }