simplify manage(), remove screen arg
This commit is contained in:
parent
30e7cf5b40
commit
ef69814e29
|
@ -154,7 +154,7 @@ scan(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
|| XGetTransientForHint(disp, wins[i], &d1))
|
|| XGetTransientForHint(disp, wins[i], &d1))
|
||||||
continue;
|
continue;
|
||||||
if(wa.map_state == IsViewable || getstate(disp, wins[i]) == IconicState)
|
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 */
|
/* now the transients */
|
||||||
for(i = 0; i < num; i++)
|
for(i = 0; i < num; i++)
|
||||||
|
@ -163,7 +163,7 @@ scan(Display *disp, int screen, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
continue;
|
continue;
|
||||||
if(XGetTransientForHint(disp, wins[i], &d1)
|
if(XGetTransientForHint(disp, wins[i], &d1)
|
||||||
&& (wa.map_state == IsViewable || getstate(disp, wins[i]) == IconicState))
|
&& (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)
|
if(wins)
|
||||||
|
|
10
client.c
10
client.c
|
@ -348,7 +348,7 @@ loadprops(Client * c, int ntags)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
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;
|
int i;
|
||||||
Client *c, *t = NULL;
|
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->h = c->rh = wa->height;
|
||||||
c->oldborder = wa->border_width;
|
c->oldborder = wa->border_width;
|
||||||
c->display = disp;
|
c->display = disp;
|
||||||
c->screen = screen;
|
c->screen = awesomeconf->screen;
|
||||||
if(c->w == DisplayWidth(disp, screen)
|
if(c->w == DisplayWidth(disp, c->screen)
|
||||||
&& c->h == DisplayHeight(disp, screen))
|
&& c->h == DisplayHeight(disp, c->screen))
|
||||||
{
|
{
|
||||||
c->x = 0;
|
c->x = 0;
|
||||||
c->y = 0;
|
c->y = 0;
|
||||||
|
@ -376,7 +376,7 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
|
||||||
}
|
}
|
||||||
else
|
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)
|
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;
|
c->x = c->rx = si->x_org + si->width - c->w - 2 * c->border;
|
||||||
|
|
2
client.h
2
client.h
|
@ -60,7 +60,7 @@ void ban(Client *); /* bans c */
|
||||||
void configure(Client *); /* send synthetic configure event */
|
void configure(Client *); /* send synthetic configure event */
|
||||||
void detach(Client *); /* detaches c from global client list */
|
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 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 resize(Client *, int, int, int, int, Bool); /* resize with given coordinates c */
|
||||||
void unban(Client *); /* unbans c */
|
void unban(Client *); /* unbans c */
|
||||||
void unmanage(Client *, DC *, long, awesome_config *); /* unmanage c */
|
void unmanage(Client *, DC *, long, awesome_config *); /* unmanage c */
|
||||||
|
|
2
event.c
2
event.c
|
@ -387,7 +387,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf)
|
||||||
if(!getclient(ev->window))
|
if(!getclient(ev->window))
|
||||||
{
|
{
|
||||||
for(screen = 0; wa.screen != ScreenOfDisplay(e->xany.display, screen); screen++);
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue