From c02be2ab82d618c9848fe5842eadb333d63d69de Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 15 Sep 2007 22:36:23 +0200 Subject: [PATCH] store screen of client, first step to multi head support --- awesome.c | 4 ++-- client.c | 3 ++- client.h | 3 ++- event.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/awesome.c b/awesome.c index 6cccd7374..e818d7844 100644 --- a/awesome.c +++ b/awesome.c @@ -109,7 +109,7 @@ scan(Display *disp, DC *drawcontext, awesome_config *awesomeconf) || XGetTransientForHint(disp, wins[i], &d1)) continue; 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 */ for(i = 0; i < num; i++) @@ -118,7 +118,7 @@ scan(Display *disp, DC *drawcontext, awesome_config *awesomeconf) continue; if(XGetTransientForHint(disp, wins[i], &d1) && (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) XFree(wins); diff --git a/client.c b/client.c index 7dd1a5b44..89617a6ab 100644 --- a/client.c +++ b/client.c @@ -347,7 +347,7 @@ loadprops(Client * c, int ntags) } 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; 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->oldborder = wa->border_width; c->display = disp; + c->screen = screen; if(c->w == DisplayWidth(disp, DefaultScreen(disp)) && c->h == DisplayHeight(disp, DefaultScreen(disp))) { diff --git a/client.h b/client.h index 9dc449269..959f8e4a0 100644 --- a/client.h +++ b/client.h @@ -45,6 +45,7 @@ struct Client Client *snext; Window win; Display * display; + int screen; 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 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 *, 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 unban(Client *); /* unbans c */ void unmanage(Client *, DC *, long, awesome_config *); /* unmanage c */ diff --git a/event.c b/event.c index b3cbbb60c..b1b17ae0c 100644 --- a/event.c +++ b/event.c @@ -351,7 +351,7 @@ handle_event_maprequest(XEvent * e, awesome_config *awesomeconf) if(wa.override_redirect) return; 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