check that loadawesomeprops() set view on at least one tag
This commit is contained in:
parent
a84eae2700
commit
83e58a3a73
|
@ -52,6 +52,7 @@
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "focus.h"
|
#include "focus.h"
|
||||||
#include "ewmh.h"
|
#include "ewmh.h"
|
||||||
|
#include "tag.h"
|
||||||
#include "common/awclient.h"
|
#include "common/awclient.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/awesome-version.h"
|
#include "common/awesome-version.h"
|
||||||
|
@ -309,7 +310,9 @@ main(int argc, char *argv[])
|
||||||
/* do this only for real screen */
|
/* do this only for real screen */
|
||||||
for(screen = 0; screen < ScreenCount(dpy); 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);
|
ewmh_set_supported_hints(screen);
|
||||||
/* call this to at least grab root window clicks */
|
/* call this to at least grab root window clicks */
|
||||||
window_root_grabbuttons(screen);
|
window_root_grabbuttons(screen);
|
||||||
|
|
11
layout.c
11
layout.c
|
@ -111,12 +111,13 @@ layout_get_current(int screen)
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
Bool
|
||||||
loadawesomeprops(int screen)
|
loadawesomeprops(int screen)
|
||||||
{
|
{
|
||||||
int i, ntags = 0;
|
int i, ntags = 0;
|
||||||
char *prop;
|
char *prop;
|
||||||
Tag *tag;
|
Tag *tag;
|
||||||
|
Bool ret = False;
|
||||||
|
|
||||||
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
|
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
|
||||||
ntags++;
|
ntags++;
|
||||||
|
@ -127,9 +128,15 @@ loadawesomeprops(int screen)
|
||||||
XInternAtom(globalconf.display, "_AWESOME_PROPERTIES", False),
|
XInternAtom(globalconf.display, "_AWESOME_PROPERTIES", False),
|
||||||
prop, ntags + 1))
|
prop, ntags + 1))
|
||||||
for(i = 0, tag = globalconf.screens[screen].tags; tag && prop[i]; i++, tag = tag->next)
|
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);
|
p_delete(&prop);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
2
layout.h
2
layout.h
|
@ -42,7 +42,7 @@ DO_SLIST(Layout, layout, p_delete);
|
||||||
|
|
||||||
int layout_refresh(void);
|
int layout_refresh(void);
|
||||||
Layout * layout_get_current(int);
|
Layout * layout_get_current(int);
|
||||||
void loadawesomeprops(int);
|
Bool loadawesomeprops(int);
|
||||||
void saveawesomeprops(int);
|
void saveawesomeprops(int);
|
||||||
|
|
||||||
Uicb uicb_tag_setlayout;
|
Uicb uicb_tag_setlayout;
|
||||||
|
|
Loading…
Reference in New Issue