JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
mcbrides crazy baraction.sh overflows the bar so make it bigger
[spectrwm.git] / scrotwm.c
index f6e5070..da45725 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -160,7 +160,7 @@ int                 font_adjusted = 0;
 /* dialog windows */
 double                 dialog_ratio = .6;
 /* status bar */
-#define SWM_BAR_MAX    (128)
+#define SWM_BAR_MAX    (256)
 char                   *bar_argv[] = { NULL, NULL };
 int                    bar_pipe[2];
 char                   bar_ext[SWM_BAR_MAX];
@@ -249,6 +249,7 @@ void        horizontal_stack(struct workspace *, struct swm_geometry *);
 void   max_stack(struct workspace *, struct swm_geometry *);
 
 void   grabbuttons(struct ws_win *, int);
+void   new_region(struct swm_screen *, int, int, int, int);
 
 struct layout {
        void            (*l_stack)(struct workspace *, struct swm_geometry *);
@@ -437,8 +438,6 @@ setscreencolor(char *val, int i, int c)
                    i, ScreenCount(display));
 }
 
-void           new_region(struct swm_screen *, int, int, int, int);
-
 void
 custom_region(char *val)
 {
@@ -706,15 +705,15 @@ bar_toggle(struct swm_region *r, union arg *args)
 
        DNPRINTF(SWM_D_MISC, "bar_toggle\n");
 
-       if (bar_enabled) {
+       if (bar_enabled)
                for (i = 0; i < sc; i++)
                        TAILQ_FOREACH(tmpr, &screens[i].rl, entry)
                                XUnmapWindow(display, tmpr->bar_window);
-       } else {
+       else
                for (i = 0; i < sc; i++)
                        TAILQ_FOREACH(tmpr, &screens[i].rl, entry)
                                XMapRaised(display, tmpr->bar_window);
-       }
+
        bar_enabled = !bar_enabled;
        for (i = 0; i < sc; i++)
                for (j = 0; j < SWM_WS_MAX; j++)
@@ -2790,6 +2789,11 @@ screenchange(XEvent *e) {
        TAILQ_FOREACH(r, &screens[i].rl, entry)
                TAILQ_FOREACH(win, &r->ws->winlist, entry)
                        XUnmapWindow(display, win->id);
+
+       /* add bars to all regions */
+       for (i = 0; i < ScreenCount(display); i++)
+               TAILQ_FOREACH(r, &screens[i].rl, entry)
+                       bar_setup(r);
        stack();
 }