arrange() does not need Display as arg

This commit is contained in:
Julien Danjou 2007-10-15 18:23:05 +02:00
parent 17bc4dc9a7
commit ccb7e89750
9 changed files with 31 additions and 31 deletions

View File

@ -441,7 +441,7 @@ manage(Display *disp, Window w, XWindowAttributes *wa, awesome_config *awesomeco
attach(awesomeconf->clients, c); attach(awesomeconf->clients, c);
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
c->isbanned = True; c->isbanned = True;
arrange(disp, awesomeconf); arrange(awesomeconf);
} }
void void
@ -573,7 +573,7 @@ unmanage(Client * c, long state, awesome_config *awesomeconf)
XSetErrorHandler(xerror); XSetErrorHandler(xerror);
XUngrabServer(c->display); XUngrabServer(c->display);
if(state != NormalState) if(state != NormalState)
arrange(c->display, awesomeconf); arrange(awesomeconf);
p_delete(&c->tags); p_delete(&c->tags);
p_delete(&c); p_delete(&c);
} }
@ -732,7 +732,7 @@ uicb_swapnext(awesome_config *awesomeconf,
if(next) if(next)
{ {
client_swap(awesomeconf->clients, *awesomeconf->client_sel, next); client_swap(awesomeconf->clients, *awesomeconf->client_sel, next);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
} }
@ -749,7 +749,7 @@ uicb_swapprev(awesome_config *awesomeconf,
if(prev) if(prev)
{ {
client_swap(awesomeconf->clients, prev, *awesomeconf->client_sel); client_swap(awesomeconf->clients, prev, *awesomeconf->client_sel);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
} }

View File

@ -328,7 +328,7 @@ handle_event_configurenotify(XEvent * e, awesome_config *awesomeconf)
awesomeconf[screen].statusbar.height); awesomeconf[screen].statusbar.height);
updatebarpos(e->xany.display, awesomeconf[screen].statusbar); updatebarpos(e->xany.display, awesomeconf[screen].statusbar);
arrange(e->xany.display, &awesomeconf[screen]); arrange(&awesomeconf[screen]);
} }
} }
@ -476,7 +476,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
case XA_WM_TRANSIENT_FOR: case XA_WM_TRANSIENT_FOR:
XGetTransientForHint(e->xany.display, c->win, &trans); XGetTransientForHint(e->xany.display, c->win, &trans);
if(!c->isfloating && (c->isfloating = (get_client_bywin(awesomeconf->clients, trans) != NULL))) if(!c->isfloating && (c->isfloating = (get_client_bywin(awesomeconf->clients, trans) != NULL)))
arrange(e->xany.display, &awesomeconf[c->screen]); arrange(&awesomeconf[c->screen]);
break; break;
case XA_WM_NORMAL_HINTS: case XA_WM_NORMAL_HINTS:
updatesizehints(c); updatesizehints(c);

View File

@ -34,7 +34,7 @@
* \param awesomeconf awesome config * \param awesomeconf awesome config
*/ */
void void
arrange(Display * disp, awesome_config *awesomeconf) arrange(awesome_config *awesomeconf)
{ {
Client *c; Client *c;
@ -47,8 +47,8 @@ arrange(Display * disp, awesome_config *awesomeconf)
ban(c); ban(c);
} }
awesomeconf->current_layout->arrange(awesomeconf); awesomeconf->current_layout->arrange(awesomeconf);
focus(disp, NULL, True, awesomeconf); focus(awesomeconf->display, NULL, True, awesomeconf);
restack(disp, awesomeconf); restack(awesomeconf->display, awesomeconf);
} }
void void
@ -193,7 +193,7 @@ uicb_setlayout(awesome_config * awesomeconf,
c->ftview = True; c->ftview = True;
if(*awesomeconf->client_sel) if(*awesomeconf->client_sel)
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
else else
drawstatusbar(awesomeconf); drawstatusbar(awesomeconf);
@ -230,7 +230,7 @@ maximize(int x, int y, int w, int h, awesome_config *awesomeconf)
else else
(*awesomeconf->client_sel)->isfloating = False; (*awesomeconf->client_sel)->isfloating = False;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
void void
@ -286,7 +286,7 @@ uicb_zoom(awesome_config *awesomeconf,
detach(awesomeconf->clients, *awesomeconf->client_sel); detach(awesomeconf->clients, *awesomeconf->client_sel);
attach(awesomeconf->clients, *awesomeconf->client_sel); attach(awesomeconf->clients, *awesomeconf->client_sel);
focus(awesomeconf->display, *awesomeconf->client_sel, True, awesomeconf); focus(awesomeconf->display, *awesomeconf->client_sel, True, awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -29,7 +29,7 @@
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False) #define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
void arrange(Display *, awesome_config *); /* arranges all windows depending on the layout in use */ void arrange(awesome_config *); /* arranges all windows depending on the layout in use */
void restack(Display *, awesome_config *); /* restores z layers of all clients */ void restack(Display *, awesome_config *); /* restores z layers of all clients */
void loadawesomeprops(awesome_config *); void loadawesomeprops(awesome_config *);
void saveawesomeprops(awesome_config *); void saveawesomeprops(awesome_config *);

View File

@ -39,7 +39,7 @@ uicb_setnmaster(awesome_config *awesomeconf,
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0) if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
awesomeconf->nmaster = 0; awesomeconf->nmaster = 0;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
void void
@ -52,7 +52,7 @@ uicb_setncol(awesome_config *awesomeconf,
if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1) if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1)
awesomeconf->ncol = 1; awesomeconf->ncol = 1;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
void void
@ -78,7 +78,7 @@ uicb_setmwfact(awesome_config * awesomeconf,
else if(awesomeconf->mwfact > 0.9) else if(awesomeconf->mwfact > 0.9)
awesomeconf->mwfact = 0.9; awesomeconf->mwfact = 0.9;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
p_delete(&newarg); p_delete(&newarg);
} }

View File

@ -246,7 +246,7 @@ uicb_movetoscreen(awesome_config * awesomeconf,
prev_screen = (*awesomeconf->client_sel)->screen; prev_screen = (*awesomeconf->client_sel)->screen;
move_client_to_screen(*awesomeconf->client_sel, &awesomeconf[new_screen - awesomeconf->screen], True); move_client_to_screen(*awesomeconf->client_sel, &awesomeconf[new_screen - awesomeconf->screen], True);
move_mouse_pointer_to_screen(awesomeconf->display, new_screen); move_mouse_pointer_to_screen(awesomeconf->display, new_screen);
arrange(awesomeconf->display, &awesomeconf[prev_screen - awesomeconf->screen]); arrange(&awesomeconf[prev_screen - awesomeconf->screen]);
arrange(awesomeconf->display, &awesomeconf[new_screen - awesomeconf->screen]); arrange(&awesomeconf[new_screen - awesomeconf->screen]);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99

View File

@ -247,7 +247,7 @@ uicb_togglebar(awesome_config *awesomeconf,
else else
awesomeconf->statusbar.position = BarOff; awesomeconf->statusbar.position = BarOff;
updatebarpos(awesomeconf->display, awesomeconf->statusbar); updatebarpos(awesomeconf->display, awesomeconf->statusbar);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }

8
tab.c
View File

@ -85,7 +85,7 @@ uicb_tab(awesome_config *awesomeconf,
c->tab.prev = tmp; c->tab.prev = tmp;
c->tab.isvisible = False; c->tab.isvisible = False;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel, True, awesomeconf); focus(awesomeconf->display, sel, True, awesomeconf);
} }
} }
@ -100,7 +100,7 @@ uicb_untab(awesome_config *awesomeconf,
return; return;
client_untab(sel); client_untab(sel);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel, True, awesomeconf); focus(awesomeconf->display, sel, True, awesomeconf);
} }
@ -115,7 +115,7 @@ uicb_viewnexttab(awesome_config *awesomeconf,
sel->tab.isvisible = False; sel->tab.isvisible = False;
sel->tab.next->tab.isvisible = True; sel->tab.next->tab.isvisible = True;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel->tab.next, True, awesomeconf); focus(awesomeconf->display, sel->tab.next, True, awesomeconf);
} }
@ -130,7 +130,7 @@ uicb_viewprevtab(awesome_config *awesomeconf,
sel->tab.isvisible = False; sel->tab.isvisible = False;
sel->tab.prev->tab.isvisible = True; sel->tab.prev->tab.isvisible = True;
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel->tab.prev, True, awesomeconf); focus(awesomeconf->display, sel->tab.prev, True, awesomeconf);
} }

16
tag.c
View File

@ -158,7 +158,7 @@ uicb_tag(awesome_config *awesomeconf,
if(i >= 0 && i < awesomeconf->ntags) if(i >= 0 && i < awesomeconf->ntags)
(*awesomeconf->client_sel)->tags[i] = True; (*awesomeconf->client_sel)->tags[i] = True;
saveprops(*awesomeconf->client_sel, awesomeconf->ntags); saveprops(*awesomeconf->client_sel, awesomeconf->ntags);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** Toggle floating state of a client /** Toggle floating state of a client
@ -190,7 +190,7 @@ uicb_togglefloating(awesome_config * awesomeconf,
} }
client_untab(*awesomeconf->client_sel); client_untab(*awesomeconf->client_sel);
saveprops(*awesomeconf->client_sel, awesomeconf->ntags); saveprops(*awesomeconf->client_sel, awesomeconf->ntags);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** Toggle tag view /** Toggle tag view
@ -212,7 +212,7 @@ uicb_toggletag(awesome_config *awesomeconf,
if(j == awesomeconf->ntags) if(j == awesomeconf->ntags)
(*awesomeconf->client_sel)->tags[i] = True; (*awesomeconf->client_sel)->tags[i] = True;
saveprops(*awesomeconf->client_sel, awesomeconf->ntags); saveprops(*awesomeconf->client_sel, awesomeconf->ntags);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** Add a tag to viewed tags /** Add a tag to viewed tags
@ -232,7 +232,7 @@ uicb_toggleview(awesome_config *awesomeconf,
if(j == awesomeconf->ntags) if(j == awesomeconf->ntags)
awesomeconf->tags[i].selected = True; awesomeconf->tags[i].selected = True;
saveawesomeprops(awesomeconf); saveawesomeprops(awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** View tag /** View tag
@ -258,7 +258,7 @@ uicb_view(awesome_config *awesomeconf,
awesomeconf->current_layout = awesomeconf->tags[i].layout; awesomeconf->current_layout = awesomeconf->tags[i].layout;
} }
saveawesomeprops(awesomeconf); saveawesomeprops(awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** View previously selected tags /** View previously selected tags
@ -279,7 +279,7 @@ uicb_tag_prev_selected(awesome_config *awesomeconf,
awesomeconf->tags[i].selected = awesomeconf->tags[i].was_selected; awesomeconf->tags[i].selected = awesomeconf->tags[i].was_selected;
awesomeconf->tags[i].was_selected = t; awesomeconf->tags[i].was_selected = t;
} }
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** View next tag /** View next tag
@ -304,7 +304,7 @@ uicb_tag_viewnext(awesome_config *awesomeconf,
awesomeconf->tags[firsttag].selected = True; awesomeconf->tags[firsttag].selected = True;
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout; awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
saveawesomeprops(awesomeconf); saveawesomeprops(awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
/** View previous tag /** View previous tag
@ -329,6 +329,6 @@ uicb_tag_viewprev(awesome_config *awesomeconf,
awesomeconf->tags[firsttag].selected = True; awesomeconf->tags[firsttag].selected = True;
awesomeconf->current_layout = awesomeconf->tags[firsttag].layout; awesomeconf->current_layout = awesomeconf->tags[firsttag].layout;
saveawesomeprops(awesomeconf); saveawesomeprops(awesomeconf);
arrange(awesomeconf->display, awesomeconf); arrange(awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99