restack and arrange take screen as arg

This commit is contained in:
Julien Danjou 2007-09-15 23:17:59 +02:00
parent 389e1f809a
commit e91de5bfb9
7 changed files with 29 additions and 29 deletions

View File

@ -415,7 +415,7 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
attachstack(c);
XMoveResizeWindow(disp, c->win, c->x, c->y, c->w, c->h); /* some windows require this */
c->isbanned = True;
arrange(disp, drawcontext, awesomeconf);
arrange(disp, screen, drawcontext, awesomeconf);
}
void
@ -576,7 +576,7 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
XSetErrorHandler(xerror);
XUngrabServer(c->display);
if(state != NormalState)
arrange(c->display, drawcontext, awesomeconf);
arrange(c->display, c->screen, drawcontext, awesomeconf);
p_delete(&c->tags);
p_delete(&c);
}

View File

@ -183,14 +183,14 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
return;
if(ev->button == Button1 && (IS_ARRANGE(floating) || c->isfloating))
{
restack(e->xany.display, &dc, awesomeconf);
restack(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
movemouse(c, awesomeconf);
}
else if(ev->button == Button2)
uicb_zoom(e->xany.display, &dc, awesomeconf, NULL);
else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed)
{
restack(e->xany.display, &dc, awesomeconf);
restack(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
resizemouse(c, awesomeconf);
}
}
@ -270,7 +270,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, &dc, awesomeconf);
arrange(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
}
}
@ -370,7 +370,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, &dc, awesomeconf);
arrange(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
break;
case XA_WM_NORMAL_HINTS:
updatesizehints(c);

View File

@ -33,7 +33,7 @@
extern Client *clients, *sel; /* global client list */
void
arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
arrange(Display * disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
{
Client *c;
@ -43,8 +43,8 @@ arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
else
ban(c);
awesomeconf->current_layout->arrange(disp, awesomeconf);
focus(disp, DefaultScreen(disp), drawcontext, NULL, True, awesomeconf);
restack(disp, drawcontext, awesomeconf);
focus(disp, screen, drawcontext, NULL, True, awesomeconf);
restack(disp, screen, drawcontext, awesomeconf);
}
void
@ -63,7 +63,7 @@ uicb_focusnext(Display *disp __attribute__ ((unused)),
if(c)
{
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
restack(c->display, drawcontext, awesomeconf);
restack(c->display, c->screen, drawcontext, awesomeconf);
}
}
@ -86,7 +86,7 @@ uicb_focusprev(Display *disp __attribute__ ((unused)),
if(c)
{
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
restack(c->display, drawcontext, awesomeconf);
restack(c->display, c->screen, drawcontext, awesomeconf);
}
}
@ -106,13 +106,13 @@ loadawesomeprops(Display *disp, int screen, awesome_config * awesomeconf)
}
void
restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
restack(Display * disp, int screen, DC * drawcontext, awesome_config *awesomeconf)
{
Client *c;
XEvent ev;
XWindowChanges wc;
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
drawstatusbar(disp, screen, drawcontext, awesomeconf);
if(!sel)
return;
if(sel->isfloating || IS_ARRANGE(floating))
@ -180,7 +180,7 @@ uicb_setlayout(Display *disp,
c->ftview = True;
if(sel)
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
else
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
@ -275,6 +275,6 @@ uicb_zoom(Display *disp __attribute__ ((unused)),
detach(sel);
attach(sel);
focus(sel->display, sel->screen, drawcontext, sel, True, awesomeconf);
arrange(sel->display, drawcontext, awesomeconf);
arrange(sel->display, sel->screen, drawcontext, awesomeconf);
}

View File

@ -29,8 +29,8 @@
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
void arrange(Display *, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
void restack(Display *, DC *, awesome_config *); /* restores z layers of all clients */
void arrange(Display *, int, DC *, awesome_config *); /* arranges all windows depending on the layout in use */
void restack(Display *, int, DC *, awesome_config *); /* restores z layers of all clients */
void uicb_focusnext(Display *, DC *, awesome_config *, const char *); /* focuses next visible client */
void uicb_focusprev(Display *, DC *, awesome_config *, const char *); /* focuses prev visible client */
void uicb_setlayout(Display *, DC *, awesome_config *, const char *); /* sets layout, NULL means next layout */

View File

@ -43,7 +43,7 @@ uicb_setnmaster(Display *disp,
if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0)
awesomeconf->nmaster = 0;
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
void
@ -58,7 +58,7 @@ uicb_setncols(Display *disp,
if((awesomeconf->ncols = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncols)) < 1)
awesomeconf->ncols = 1;
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
void
@ -75,7 +75,7 @@ uicb_setmwfact(Display *disp,
else if(awesomeconf->mwfact > 0.9)
awesomeconf->mwfact = 0.9;
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
static void

View File

@ -149,6 +149,6 @@ uicb_togglebar(Display *disp,
else
awesomeconf->statusbar.position = BarOff;
updatebarpos(disp, awesomeconf->statusbar);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}

16
tag.c
View File

@ -159,7 +159,7 @@ uicb_tag(Display *disp,
if(i >= 0 && i < awesomeconf->ntags)
sel->tags[i] = True;
saveprops(sel, awesomeconf->ntags);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** Toggle floating state of a client
@ -188,7 +188,7 @@ uicb_togglefloating(Display *disp,
sel->rh = sel->h;
}
saveprops(sel, awesomeconf->ntags);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** Toggle tag view
@ -213,7 +213,7 @@ uicb_toggletag(Display *disp,
if(j == awesomeconf->ntags)
sel->tags[i] = True;
saveprops(sel, awesomeconf->ntags);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** Add a tag to viewed tags
@ -236,7 +236,7 @@ uicb_toggleview(Display *disp,
if(j == awesomeconf->ntags)
awesomeconf->selected_tags[i] = True; /* cannot toggle last view */
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** View tag
@ -265,7 +265,7 @@ uicb_view(Display *disp,
awesomeconf->current_layout = awesomeconf->tag_layouts[i];
}
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** View previously selected tags
@ -289,7 +289,7 @@ uicb_viewprevtags(Display * disp,
awesomeconf->selected_tags[i] = awesomeconf->prev_selected_tags[i];
awesomeconf->prev_selected_tags[i] = t;
}
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** View next tag
@ -316,7 +316,7 @@ uicb_tag_viewnext(Display *disp,
firsttag = 0;
awesomeconf->selected_tags[firsttag] = True;
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}
/** View previous tag
@ -343,5 +343,5 @@ uicb_tag_viewprev(Display *disp,
firsttag = awesomeconf->ntags - 1;
awesomeconf->selected_tags[firsttag] = True;
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
arrange(disp, drawcontext, awesomeconf);
arrange(disp, DefaultScreen(disp), drawcontext, awesomeconf);
}