parent
83e58a3a73
commit
0b6129e625
|
@ -142,6 +142,9 @@ setup(int screen)
|
||||||
|
|
||||||
grabkeys(phys_screen);
|
grabkeys(phys_screen);
|
||||||
|
|
||||||
|
/* view at least one tag */
|
||||||
|
tag_view(globalconf.screens[screen].tags, True);
|
||||||
|
|
||||||
for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
|
for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
|
||||||
statusbar_init(statusbar);
|
statusbar_init(statusbar);
|
||||||
}
|
}
|
||||||
|
@ -310,9 +313,6 @@ 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++)
|
||||||
{
|
{
|
||||||
/* 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);
|
||||||
|
|
53
layout.c
53
layout.c
|
@ -111,57 +111,6 @@ layout_get_current(int screen)
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
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++;
|
|
||||||
|
|
||||||
prop = p_new(char, ntags + 1);
|
|
||||||
|
|
||||||
if(xgettextprop(RootWindow(globalconf.display, get_phys_screen(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)
|
|
||||||
if(prop[i] == '1')
|
|
||||||
{
|
|
||||||
tag_view_byindex(screen, i, prop[i] == '1');
|
|
||||||
ret = True;
|
|
||||||
}
|
|
||||||
|
|
||||||
p_delete(&prop);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
saveawesomeprops(int screen)
|
|
||||||
{
|
|
||||||
int i, ntags = 0;
|
|
||||||
char *prop;
|
|
||||||
Tag *tag;
|
|
||||||
|
|
||||||
for(tag = globalconf.screens[screen].tags; tag; tag = tag->next)
|
|
||||||
ntags++;
|
|
||||||
|
|
||||||
prop = p_new(char, ntags + 1);
|
|
||||||
|
|
||||||
for(i = 0, tag = globalconf.screens[screen].tags; tag; tag = tag->next, i++)
|
|
||||||
prop[i] = tag->selected ? '1' : '0';
|
|
||||||
|
|
||||||
prop[i] = '\0';
|
|
||||||
XChangeProperty(globalconf.display,
|
|
||||||
RootWindow(globalconf.display, get_phys_screen(screen)),
|
|
||||||
XInternAtom(globalconf.display, "_AWESOME_PROPERTIES", False),
|
|
||||||
XA_STRING, 8, PropModeReplace, (unsigned char *) prop, i);
|
|
||||||
p_delete(&prop);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Set layout for tag
|
/** Set layout for tag
|
||||||
* \param screen Screen ID
|
* \param screen Screen ID
|
||||||
* \param arg Layout specifier
|
* \param arg Layout specifier
|
||||||
|
@ -204,8 +153,6 @@ uicb_tag_setlayout(int screen, char *arg)
|
||||||
arrange(screen);
|
arrange(screen);
|
||||||
|
|
||||||
widget_invalidate_cache(screen, WIDGET_CACHE_LAYOUTS);
|
widget_invalidate_cache(screen, WIDGET_CACHE_LAYOUTS);
|
||||||
|
|
||||||
saveawesomeprops(screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
2
layout.h
2
layout.h
|
@ -42,8 +42,6 @@ DO_SLIST(Layout, layout, p_delete);
|
||||||
|
|
||||||
int layout_refresh(void);
|
int layout_refresh(void);
|
||||||
Layout * layout_get_current(int);
|
Layout * layout_get_current(int);
|
||||||
Bool loadawesomeprops(int);
|
|
||||||
void saveawesomeprops(int);
|
|
||||||
|
|
||||||
Uicb uicb_tag_setlayout;
|
Uicb uicb_tag_setlayout;
|
||||||
|
|
||||||
|
|
1
tag.c
1
tag.c
|
@ -325,7 +325,6 @@ tag_view(Tag *tag, Bool view)
|
||||||
tag->selected = view;
|
tag->selected = view;
|
||||||
ewmh_update_net_current_desktop(get_phys_screen(tag->screen));
|
ewmh_update_net_current_desktop(get_phys_screen(tag->screen));
|
||||||
widget_invalidate_cache(tag->screen, WIDGET_CACHE_TAGS);
|
widget_invalidate_cache(tag->screen, WIDGET_CACHE_TAGS);
|
||||||
saveawesomeprops(tag->screen);
|
|
||||||
globalconf.screens[tag->screen].need_arrange = True;
|
globalconf.screens[tag->screen].need_arrange = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue