From de3fdc02d875d5ed7ad1bec09aeaa9f576d159f2 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 12 Sep 2007 17:00:33 +0200 Subject: [PATCH] add DC to arrange() --- client.c | 4 ++-- event.c | 4 ++-- layout.c | 10 +++++----- layout.h | 2 +- layouts/tile.c | 4 ++-- tag.c | 17 +++++++++-------- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/client.c b/client.c index cf2c2113..e878048e 100644 --- a/client.c +++ b/client.c @@ -406,7 +406,7 @@ manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, awesom attachstack(c); XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ ban(c); - arrange(disp, awesomeconf); + arrange(disp, drawcontext, awesomeconf); } void @@ -566,7 +566,7 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf) XSetErrorHandler(xerror); XUngrabServer(c->display); if(state != NormalState) - arrange(c->display, awesomeconf); + arrange(c->display, drawcontext, awesomeconf); p_delete(&c->tags); p_delete(&c); } diff --git a/event.c b/event.c index e14865c5..02a1a8cd 100644 --- a/event.c +++ b/event.c @@ -265,7 +265,7 @@ handle_event_configurenotify(XEvent * e, awesome_config *awesomeconf) XResizeWindow(e->xany.display, awesomeconf->statusbar.window, DisplayWidth(e->xany.display, DefaultScreen(e->xany.display)), awesomeconf->statusbar.height); updatebarpos(e->xany.display, awesomeconf->statusbar); - arrange(e->xany.display, awesomeconf); + arrange(e->xany.display, &dc, awesomeconf); } } @@ -365,7 +365,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf) case XA_WM_TRANSIENT_FOR: XGetTransientForHint(e->xany.display, c->win, &trans); if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL))) - arrange(e->xany.display, awesomeconf); + arrange(e->xany.display, &dc, awesomeconf); break; case XA_WM_NORMAL_HINTS: updatesizehints(c); diff --git a/layout.c b/layout.c index ef2075d3..7ebe2c23 100644 --- a/layout.c +++ b/layout.c @@ -32,7 +32,7 @@ extern Client *clients, *sel; /* global client list */ extern DC dc; void -arrange(Display * disp, awesome_config *awesomeconf) +arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf) { Client *c; @@ -42,7 +42,7 @@ arrange(Display * disp, awesome_config *awesomeconf) else ban(c); awesomeconf->current_layout->arrange(disp, awesomeconf); - focus(disp, &dc, NULL, True, awesomeconf); + focus(disp, drawcontext, NULL, True, awesomeconf); restack(disp, awesomeconf); } @@ -174,7 +174,7 @@ uicb_setlayout(Display *disp, awesome_config * awesomeconf, const char *arg) c->ftview = True; if(sel) - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); else drawstatus(disp, &dc, awesomeconf); @@ -195,7 +195,7 @@ uicb_togglebar(Display *disp, else awesomeconf->statusbar.position = BarOff; updatebarpos(disp, awesomeconf->statusbar); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } static void @@ -274,6 +274,6 @@ uicb_zoom(Display *disp __attribute__ ((unused)), detach(sel); attach(sel); focus(sel->display, &dc, sel, True, awesomeconf); - arrange(sel->display, awesomeconf); + arrange(sel->display, &dc, awesomeconf); } diff --git a/layout.h b/layout.h index f1f40d84..bf7c2553 100644 --- a/layout.h +++ b/layout.h @@ -29,7 +29,7 @@ #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(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */ void restack(Display *, awesome_config *); /* restores z layers of all clients */ void uicb_focusnext(Display *, awesome_config *, const char *); /* focuses next visible client */ void uicb_focusprev(Display *, awesome_config *, const char *); /* focuses prev visible client */ diff --git a/layouts/tile.c b/layouts/tile.c index 956c72e4..66661f74 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -59,7 +59,7 @@ uicb_setnmaster(Display *disp, return; } if(sel) - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); else drawstatus(disp, &dc, awesomeconf); } @@ -88,7 +88,7 @@ uicb_setmwfact(Display *disp, else if(mwfact > 0.9) mwfact = 0.9; } - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } static void diff --git a/tag.c b/tag.c index 70c3dfc0..aaacf2dc 100644 --- a/tag.c +++ b/tag.c @@ -26,6 +26,7 @@ #include "tag.h" extern Client *sel; /* global client list */ +extern DC dc; static Regs *regs = NULL; @@ -155,7 +156,7 @@ uicb_tag(Display *disp, awesome_config *awesomeconf, const char *arg) if(i >= 0 && i < awesomeconf->ntags) sel->tags[i] = True; saveprops(sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** Toggle floating state of a client @@ -183,7 +184,7 @@ uicb_togglefloating(Display *disp, sel->rh = sel->h; } saveprops(sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** Toggle tag view @@ -207,7 +208,7 @@ uicb_toggletag(Display *disp, if(j == awesomeconf->ntags) sel->tags[i] = True; saveprops(sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** Add a tag to viewed tags @@ -229,7 +230,7 @@ uicb_toggleview(Display *disp, if(j == awesomeconf->ntags) awesomeconf->selected_tags[i] = True; /* cannot toggle last view */ saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** View tag @@ -257,7 +258,7 @@ uicb_view(Display *disp, awesomeconf->current_layout = awesomeconf->tag_layouts[i]; } saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** View previously selected tags @@ -280,7 +281,7 @@ uicb_viewprevtags(Display * disp, awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i]; awesomeconf->prev_selected_tags[i] = t; } - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** View next tag @@ -306,7 +307,7 @@ uicb_tag_viewnext(Display *disp, firsttag = 0; awesomeconf->selected_tags[firsttag] = True; saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); } /** View previous tag @@ -332,5 +333,5 @@ uicb_tag_viewprev(Display *disp, firsttag = awesomeconf->ntags - 1; awesomeconf->selected_tags[firsttag] = True; saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + arrange(disp, &dc, awesomeconf); }