store screen of client, first step to multi head support

This commit is contained in:
Julien Danjou 2007-09-15 22:36:23 +02:00
parent 48f17aa9f1
commit c02be2ab82
4 changed files with 7 additions and 5 deletions

View File

@ -109,7 +109,7 @@ scan(Display *disp, 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, drawcontext, wins[i], &wa, awesomeconf); manage(disp, DefaultScreen(disp), drawcontext, wins[i], &wa, awesomeconf);
} }
/* now the transients */ /* now the transients */
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
@ -118,7 +118,7 @@ scan(Display *disp, 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, drawcontext, wins[i], &wa, awesomeconf); manage(disp, DefaultScreen(disp), drawcontext, wins[i], &wa, awesomeconf);
} }
if(wins) if(wins)
XFree(wins); XFree(wins);

View File

@ -347,7 +347,7 @@ loadprops(Client * c, int ntags)
} }
void void
manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, awesome_config *awesomeconf) manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes * wa, awesome_config *awesomeconf)
{ {
int i; int i;
Client *c, *t = NULL; Client *c, *t = NULL;
@ -365,6 +365,7 @@ manage(Display * disp, DC *drawcontext, Window w, XWindowAttributes * wa, awesom
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;
if(c->w == DisplayWidth(disp, DefaultScreen(disp)) if(c->w == DisplayWidth(disp, DefaultScreen(disp))
&& c->h == DisplayHeight(disp, DefaultScreen(disp))) && c->h == DisplayHeight(disp, DefaultScreen(disp)))
{ {

View File

@ -45,6 +45,7 @@ struct Client
Client *snext; Client *snext;
Window win; Window win;
Display * display; Display * display;
int screen;
Bool ftview; /* first time viewed on new layout */ Bool ftview; /* first time viewed on new layout */
}; };
@ -53,7 +54,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 *, DC *, Window, XWindowAttributes *, awesome_config *); /* manage new client */ void manage(Display *, int, DC *, Window, XWindowAttributes *, awesome_config *); /* manage new client */
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 */

View File

@ -351,7 +351,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf)
if(wa.override_redirect) if(wa.override_redirect)
return; return;
if(!getclient(ev->window)) if(!getclient(ev->window))
manage(e->xany.display, &dc, ev->window, &wa, awesomeconf); manage(e->xany.display, DefaultScreen(e->xany.display), &dc, ev->window, &wa, awesomeconf);
} }
void void