add screen args to focus()

This commit is contained in:
Julien Danjou 2007-09-15 22:51:09 +02:00
parent bf4007eef5
commit 3cc29b0250
4 changed files with 20 additions and 20 deletions

View file

@ -257,7 +257,7 @@ detach(Client * c)
* \param awesomeconf awesome config
*/
void
focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config *awesomeconf)
focus(Display *disp, int screen, DC *drawcontext, Client * c, Bool selscreen, awesome_config *awesomeconf)
{
/* if c is NULL or invisible, take next client in the stack */
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags)))
@ -290,7 +290,7 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config
setclienttrans(sel, -1);
}
else
XSetInputFocus(disp, DefaultRootWindow(disp), RevertToPointerRoot, CurrentTime);
XSetInputFocus(disp, RootWindow(disp, screen), RevertToPointerRoot, CurrentTime);
}
/** Kill selected client
@ -366,8 +366,8 @@ manage(Display * disp, int screen, DC *drawcontext, Window w, XWindowAttributes
c->oldborder = wa->border_width;
c->display = disp;
c->screen = screen;
if(c->w == DisplayWidth(disp, DefaultScreen(disp))
&& c->h == DisplayHeight(disp, DefaultScreen(disp)))
if(c->w == DisplayWidth(disp, screen)
&& c->h == DisplayHeight(disp, screen))
{
c->x = 0;
c->y = 0;
@ -467,10 +467,10 @@ resize(Client * c, int x, int y, int w, int h, Bool sizehints)
if(w <= 0 || h <= 0)
return;
/* offscreen appearance fixes */
if(x > DisplayWidth(c->display, DefaultScreen(c->display)))
x = DisplayWidth(c->display, DefaultScreen(c->display)) - w - 2 * c->border;
if(y > DisplayHeight(c->display, DefaultScreen(c->display)))
y = DisplayHeight(c->display, DefaultScreen(c->display)) - h - 2 * c->border;
if(x > DisplayWidth(c->display, c->screen))
x = DisplayWidth(c->display, c->screen) - w - 2 * c->border;
if(y > DisplayHeight(c->display, c->screen))
y = DisplayHeight(c->display, c->screen) - h - 2 * c->border;
if(x + w + 2 * c->border < 0)
x = 0;
if(y + h + 2 * c->border < 0)
@ -515,7 +515,7 @@ uicb_moveresize(Display *disp __attribute__ ((unused)),
ow = sel->w;
oh = sel->h;
Bool xqp = XQueryPointer(sel->display, DefaultRootWindow(sel->display), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
Bool xqp = XQueryPointer(sel->display, RootWindow(sel->display, sel->screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
resize(sel, nx, ny, nw, nh, True);
if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my)
{
@ -569,7 +569,7 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf)
detach(c);
detachstack(c);
if(sel == c)
focus(c->display, drawcontext, NULL, True, awesomeconf);
focus(c->display, c->screen, drawcontext, NULL, True, awesomeconf);
XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
setclientstate(c, state);
XSync(c->display, False);
@ -653,7 +653,7 @@ set_shape(Client *c)
/* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */
if (XShapeQueryExtents(c->display, c->win, &bounding_shaped, &i, &i,
&u, &u, &b, &i, &i, &u, &u) && bounding_shaped)
XShapeCombineShape(c->display, DefaultRootWindow(c->display), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet);
XShapeCombineShape(c->display, RootWindow(c->display, c->screen), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet);
}
void

View file

@ -53,7 +53,7 @@ void attach(Client *); /* attaches c to global client list */
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 focus(Display *, int, 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 resize(Client *, int, int, int, int, Bool); /* resize with given coordinates c */
void unban(Client *); /* unbans c */

View file

@ -178,7 +178,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
}
else if((c = getclient(ev->window)))
{
focus(c->display, &dc, c, ev->same_screen, awesomeconf);
focus(c->display, c->screen, &dc, c, ev->same_screen, awesomeconf);
if(CLEANMASK(ev->state) != awesomeconf->modkey)
return;
if(ev->button == Button1 && (IS_ARRANGE(floating) || c->isfloating))
@ -293,9 +293,9 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
if((c = getclient(ev->window)))
focus(c->display, &dc, c, ev->same_screen, awesomeconf);
focus(c->display, c->screen, &dc, c, ev->same_screen, awesomeconf);
else if(ev->window == DefaultRootWindow(e->xany.display))
focus(e->xany.display, &dc, NULL, True, awesomeconf);
focus(e->xany.display, DefaultScreen(e->xany.display), &dc, NULL, True, awesomeconf);
}
void
@ -327,7 +327,7 @@ handle_event_leavenotify(XEvent * e, awesome_config *awesomeconf)
XCrossingEvent *ev = &e->xcrossing;
if((ev->window == DefaultRootWindow(e->xany.display)) && !ev->same_screen)
focus(e->xany.display, &dc, NULL, ev->same_screen, awesomeconf);
focus(e->xany.display, DefaultScreen(e->xany.display), &dc, NULL, ev->same_screen, awesomeconf);
}
void

View file

@ -43,7 +43,7 @@ arrange(Display * disp, DC *drawcontext, awesome_config *awesomeconf)
else
ban(c);
awesomeconf->current_layout->arrange(disp, awesomeconf);
focus(disp, drawcontext, NULL, True, awesomeconf);
focus(disp, DefaultScreen(disp), drawcontext, NULL, True, awesomeconf);
restack(disp, drawcontext, awesomeconf);
}
@ -62,7 +62,7 @@ uicb_focusnext(Display *disp __attribute__ ((unused)),
for(c = clients; c && !isvisible(c, awesomeconf->selected_tags, awesomeconf->ntags); c = c->next);
if(c)
{
focus(c->display, drawcontext, c, True, awesomeconf);
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
restack(c->display, drawcontext, awesomeconf);
}
}
@ -85,7 +85,7 @@ uicb_focusprev(Display *disp __attribute__ ((unused)),
}
if(c)
{
focus(c->display, drawcontext, c, True, awesomeconf);
focus(c->display, c->screen, drawcontext, c, True, awesomeconf);
restack(c->display, drawcontext, awesomeconf);
}
}
@ -274,7 +274,7 @@ uicb_zoom(Display *disp __attribute__ ((unused)),
return;
detach(sel);
attach(sel);
focus(sel->display, drawcontext, sel, True, awesomeconf);
focus(sel->display, sel->screen, drawcontext, sel, True, awesomeconf);
arrange(sel->display, drawcontext, awesomeconf);
}