From d9523d34369beab24a46058077c4dcf049418978 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 17 Sep 2007 14:02:28 +0200 Subject: [PATCH] simplify load/saveawesomeprops --- awesome.c | 2 +- layout.c | 10 +++++----- layout.h | 4 ++-- tag.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/awesome.c b/awesome.c index c7528bf3..508cbeeb 100644 --- a/awesome.c +++ b/awesome.c @@ -208,7 +208,7 @@ setup(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf) if(!drawcontext->font.set) XSetFont(disp, drawcontext->gc, drawcontext->font.xfont->fid); - loadawesomeprops(disp, screen, awesomeconf); + loadawesomeprops(disp, awesomeconf); } /** Startup Error handler to check if another window manager diff --git a/layout.c b/layout.c index 759275f5..ca7be328 100644 --- a/layout.c +++ b/layout.c @@ -94,14 +94,14 @@ uicb_focusprev(Display *disp __attribute__ ((unused)), } void -loadawesomeprops(Display *disp, int screen, awesome_config * awesomeconf) +loadawesomeprops(Display *disp, awesome_config * awesomeconf) { int i; char *prop; prop = p_new(char, awesomeconf->ntags + 1); - if(xgettextprop(disp, RootWindow(disp, screen), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1)) + if(xgettextprop(disp, RootWindow(disp, awesomeconf->screen), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1)) for(i = 0; i < awesomeconf->ntags && prop[i]; i++) awesomeconf->selected_tags[i] = prop[i] == '1'; @@ -142,7 +142,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf) } void -saveawesomeprops(Display *disp, int screen, awesome_config *awesomeconf) +saveawesomeprops(Display *disp, awesome_config *awesomeconf) { int i; char *prop; @@ -151,7 +151,7 @@ saveawesomeprops(Display *disp, int screen, awesome_config *awesomeconf) for(i = 0; i < awesomeconf->ntags; i++) prop[i] = awesomeconf->selected_tags[i] ? '1' : '0'; prop[i] = '\0'; - XChangeProperty(disp, RootWindow(disp, screen), + XChangeProperty(disp, RootWindow(disp, awesomeconf->screen), AWESOMEPROPS_ATOM(disp), XA_STRING, 8, PropModeReplace, (unsigned char *) prop, i); p_delete(&prop); @@ -187,7 +187,7 @@ uicb_setlayout(Display *disp, else drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf); - saveawesomeprops(disp, awesomeconf->screen, awesomeconf); + saveawesomeprops(disp, awesomeconf); for(j = 0; j < awesomeconf->ntags; j++) if (awesomeconf->selected_tags[j]) diff --git a/layout.h b/layout.h index 90d4cbb7..90cbd35c 100644 --- a/layout.h +++ b/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_togglehorizontalmax(Display *, DC *, awesome_config *, const char *); void uicb_zoom(Display *, DC *, awesome_config *, const char *); /* set current window first in stack */ -void loadawesomeprops(Display *, int, awesome_config *); -void saveawesomeprops(Display *disp, int, awesome_config *); +void loadawesomeprops(Display *, awesome_config *); +void saveawesomeprops(Display *, awesome_config *); #endif diff --git a/tag.c b/tag.c index 3e6d5ad6..d3e5a13b 100644 --- a/tag.c +++ b/tag.c @@ -235,7 +235,7 @@ uicb_toggleview(Display *disp, for(j = 0; j < awesomeconf->ntags && !awesomeconf->selected_tags[j]; j++); if(j == awesomeconf->ntags) awesomeconf->selected_tags[i] = True; /* cannot toggle last view */ - saveawesomeprops(disp, awesomeconf->screen, awesomeconf); + saveawesomeprops(disp, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -264,7 +264,7 @@ uicb_view(Display *disp, awesomeconf->selected_tags[i] = True; awesomeconf->current_layout = awesomeconf->tag_layouts[i]; } - saveawesomeprops(disp, awesomeconf->screen, awesomeconf); + saveawesomeprops(disp, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -315,7 +315,7 @@ uicb_tag_viewnext(Display *disp, if(++firsttag >= awesomeconf->ntags) firsttag = 0; awesomeconf->selected_tags[firsttag] = True; - saveawesomeprops(disp, awesomeconf->screen, awesomeconf); + saveawesomeprops(disp, awesomeconf); arrange(disp, drawcontext, awesomeconf); } @@ -342,6 +342,6 @@ uicb_tag_viewprev(Display *disp, if(--firsttag < 0) firsttag = awesomeconf->ntags - 1; awesomeconf->selected_tags[firsttag] = True; - saveawesomeprops(disp, awesomeconf->screen, awesomeconf); + saveawesomeprops(disp, awesomeconf); arrange(disp, drawcontext, awesomeconf); }