simplify manage(), remove screen arg

This commit is contained in:
Julien Danjou 2007-09-17 13:49:18 +02:00
parent 30e7cf5b40
commit ef69814e29
4 changed files with 9 additions and 9 deletions

View file

@ -154,7 +154,7 @@ scan(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
|| XGetTransientForHint(disp, wins[i], &d1))
continue;
if(wa.map_state == IsViewable || getstate(disp, wins[i]) == IconicState)
manage(disp, screen, drawcontext, wins[i], &wa, awesomeconf);
manage(disp, drawcontext, wins[i], &wa, awesomeconf);
}
/* now the transients */
for(i = 0; i < num; i++)
@ -163,7 +163,7 @@ scan(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
continue;
if(XGetTransientForHint(disp, wins[i], &d1)
&& (wa.map_state == IsViewable || getstate(disp, wins[i]) == IconicState))
manage(disp, screen, drawcontext, wins[i], &wa, awesomeconf);
manage(disp, drawcontext, wins[i], &wa, awesomeconf);
}
}
if(wins)

View file

@ -348,7 +348,7 @@ loadprops(Client * c, int ntags)
}
void
manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes * wa, awesome_config *awesomeconf)
manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, awesome_config *awesomeconf)
{
int i;
Client *c, *t = NULL;
@ -366,9 +366,9 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
c->h = c->rh = wa->height;
c->oldborder = wa->border_width;
c->display = disp;
c->screen = screen;
if(c->w == DisplayWidth(disp, screen)
&& c->h == DisplayHeight(disp, screen))
c->screen = awesomeconf->screen;
if(c->w == DisplayWidth(disp, c->screen)
&& c->h == DisplayHeight(disp, c->screen))
{
c->x = 0;
c->y = 0;
@ -376,7 +376,7 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
}
else
{
ScreenInfo *si = get_display_info(disp, screen, awesomeconf->statusbar);
ScreenInfo *si = get_display_info(disp, c->screen, awesomeconf->statusbar);
if(c->x + c->w + 2 * c->border > si->x_org + si->width)
c->x = c->rx = si->x_org + si->width - c->w - 2 * c->border;

View file

@ -60,7 +60,7 @@ void ban(Client *); /* bans c */
void configure(Client *); /* send synthetic configure event */
void detach(Client *); /* detaches c from global client list */
void focus(Display *, DC *, Client *, Bool, awesome_config *); /* focus c if visible && !NULL, or focus top visible */
void manage(Display *, int, DC *, Window, XWindowAttributes *, awesome_config *); /* manage new client */
void manage(Display *, DC *, Window, XWindowAttributes *, awesome_config *);
void resize(Client *, int, int, int, int, Bool); /* resize with given coordinates c */
void unban(Client *); /* unbans c */
void unmanage(Client *, DC *, long, awesome_config *); /* unmanage c */

View file

@ -387,7 +387,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf)
if(!getclient(ev->window))
{
for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++);
manage(e->xany.display, screen, &dc[screen], ev->window, &wa, &awesomeconf[screen]);
manage(e->xany.display, &dc[screen], ev->window, &wa, &awesomeconf[screen]);
}
}