load and save awesome props now take screen as arg
This commit is contained in:
parent
c02be2ab82
commit
5c78f4785f
|
@ -161,7 +161,7 @@ setup(Display *disp, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
XSetLineAttributes(disp, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(disp, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
if(!drawcontext->font.set)
|
if(!drawcontext->font.set)
|
||||||
XSetFont(disp, drawcontext->gc, drawcontext->font.xfont->fid);
|
XSetFont(disp, drawcontext->gc, drawcontext->font.xfont->fid);
|
||||||
loadawesomeprops(disp, awesomeconf);
|
loadawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
10
layout.c
10
layout.c
|
@ -91,14 +91,14 @@ uicb_focusprev(Display *disp __attribute__ ((unused)),
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
loadawesomeprops(Display *disp, awesome_config * awesomeconf)
|
loadawesomeprops(Display *disp, int screen, awesome_config * awesomeconf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *prop;
|
char *prop;
|
||||||
|
|
||||||
prop = p_new(char, awesomeconf->ntags + 1);
|
prop = p_new(char, awesomeconf->ntags + 1);
|
||||||
|
|
||||||
if(xgettextprop(disp, DefaultRootWindow(disp), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1))
|
if(xgettextprop(disp, RootWindow(disp, screen), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1))
|
||||||
for(i = 0; i < awesomeconf->ntags && prop[i]; i++)
|
for(i = 0; i < awesomeconf->ntags && prop[i]; i++)
|
||||||
awesomeconf->selected_tags[i] = prop[i] == '1';
|
awesomeconf->selected_tags[i] = prop[i] == '1';
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
saveawesomeprops(Display *disp, awesome_config *awesomeconf)
|
saveawesomeprops(Display *disp, int screen, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char *prop;
|
char *prop;
|
||||||
|
@ -148,7 +148,7 @@ saveawesomeprops(Display *disp, awesome_config *awesomeconf)
|
||||||
for(i = 0; i < awesomeconf->ntags; i++)
|
for(i = 0; i < awesomeconf->ntags; i++)
|
||||||
prop[i] = awesomeconf->selected_tags[i] ? '1' : '0';
|
prop[i] = awesomeconf->selected_tags[i] ? '1' : '0';
|
||||||
prop[i] = '\0';
|
prop[i] = '\0';
|
||||||
XChangeProperty(disp, DefaultRootWindow(disp),
|
XChangeProperty(disp, RootWindow(disp, screen),
|
||||||
AWESOMEPROPS_ATOM(disp), XA_STRING, 8,
|
AWESOMEPROPS_ATOM(disp), XA_STRING, 8,
|
||||||
PropModeReplace, (unsigned char *) prop, i);
|
PropModeReplace, (unsigned char *) prop, i);
|
||||||
p_delete(&prop);
|
p_delete(&prop);
|
||||||
|
@ -184,7 +184,7 @@ uicb_setlayout(Display *disp,
|
||||||
else
|
else
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, drawcontext, awesomeconf);
|
||||||
|
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
|
|
||||||
for(j = 0; j < awesomeconf->ntags; j++)
|
for(j = 0; j < awesomeconf->ntags; j++)
|
||||||
if (awesomeconf->selected_tags[j])
|
if (awesomeconf->selected_tags[j])
|
||||||
|
|
4
layout.h
4
layout.h
|
@ -38,7 +38,7 @@ void uicb_togglemax(Display *, DC *, awesome_config *, const char *); /* toggl
|
||||||
void uicb_toggleverticalmax(Display *, DC *, awesome_config *, const char *);
|
void uicb_toggleverticalmax(Display *, DC *, awesome_config *, const char *);
|
||||||
void uicb_togglehorizontalmax(Display *, DC *, awesome_config *, const char *);
|
void uicb_togglehorizontalmax(Display *, DC *, awesome_config *, const char *);
|
||||||
void uicb_zoom(Display *, DC *, awesome_config *, const char *); /* set current window first in stack */
|
void uicb_zoom(Display *, DC *, awesome_config *, const char *); /* set current window first in stack */
|
||||||
void loadawesomeprops(Display *, awesome_config *);
|
void loadawesomeprops(Display *, int, awesome_config *);
|
||||||
void saveawesomeprops(Display *disp, awesome_config *);
|
void saveawesomeprops(Display *disp, int, awesome_config *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
8
tag.c
8
tag.c
|
@ -235,7 +235,7 @@ uicb_toggleview(Display *disp,
|
||||||
for(j = 0; j < awesomeconf->ntags && !awesomeconf->selected_tags[j]; j++);
|
for(j = 0; j < awesomeconf->ntags && !awesomeconf->selected_tags[j]; j++);
|
||||||
if(j == awesomeconf->ntags)
|
if(j == awesomeconf->ntags)
|
||||||
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
|
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ uicb_view(Display *disp,
|
||||||
awesomeconf->selected_tags[i] = True;
|
awesomeconf->selected_tags[i] = True;
|
||||||
awesomeconf->current_layout = awesomeconf->tag_layouts[i];
|
awesomeconf->current_layout = awesomeconf->tag_layouts[i];
|
||||||
}
|
}
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ uicb_tag_viewnext(Display *disp,
|
||||||
if(++firsttag >= awesomeconf->ntags)
|
if(++firsttag >= awesomeconf->ntags)
|
||||||
firsttag = 0;
|
firsttag = 0;
|
||||||
awesomeconf->selected_tags[firsttag] = True;
|
awesomeconf->selected_tags[firsttag] = True;
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,6 +342,6 @@ uicb_tag_viewprev(Display *disp,
|
||||||
if(--firsttag < 0)
|
if(--firsttag < 0)
|
||||||
firsttag = awesomeconf->ntags - 1;
|
firsttag = awesomeconf->ntags - 1;
|
||||||
awesomeconf->selected_tags[firsttag] = True;
|
awesomeconf->selected_tags[firsttag] = True;
|
||||||
saveawesomeprops(disp, awesomeconf);
|
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue