diff --git a/awesome.c b/awesome.c index d30b4e98..aabfc14d 100644 --- a/awesome.c +++ b/awesome.c @@ -52,6 +52,7 @@ #include "client.h" #include "focus.h" #include "ewmh.h" +#include "tag.h" #include "common/awclient.h" #include "common/util.h" #include "common/awesome-version.h" @@ -309,7 +310,9 @@ main(int argc, char *argv[]) /* do this only for real screen */ for(screen = 0; screen < ScreenCount(dpy); screen++) { - loadawesomeprops(screen); + /* if loadawesomeprops fails, set view on first tag */ + if(!loadawesomeprops(screen)) + tag_view(globalconf.screens[screen].tags, True); ewmh_set_supported_hints(screen); /* call this to at least grab root window clicks */ window_root_grabbuttons(screen); diff --git a/layout.c b/layout.c index 7dd9e279..72a42cf9 100644 --- a/layout.c +++ b/layout.c @@ -111,12 +111,13 @@ layout_get_current(int screen) return l; } -void +Bool loadawesomeprops(int screen) { int i, ntags = 0; char *prop; Tag *tag; + Bool ret = False; for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) ntags++; @@ -127,9 +128,15 @@ loadawesomeprops(int screen) XInternAtom(globalconf.display, "_AWESOME_PROPERTIES", False), prop, ntags + 1)) for(i = 0, tag = globalconf.screens[screen].tags; tag && prop[i]; i++, tag = tag->next) - tag_view_byindex(screen, i, prop[i] == '1'); + if(prop[i] == '1') + { + tag_view_byindex(screen, i, prop[i] == '1'); + ret = True; + } p_delete(&prop); + + return ret; } void diff --git a/layout.h b/layout.h index b689ea7a..2ce67df3 100644 --- a/layout.h +++ b/layout.h @@ -42,7 +42,7 @@ DO_SLIST(Layout, layout, p_delete); int layout_refresh(void); Layout * layout_get_current(int); -void loadawesomeprops(int); +Bool loadawesomeprops(int); void saveawesomeprops(int); Uicb uicb_tag_setlayout;