focus does not need Display as arg

This commit is contained in:
Julien Danjou 2007-10-15 18:25:29 +02:00
parent ccb7e89750
commit 0026bd3813
6 changed files with 18 additions and 18 deletions

View File

@ -296,7 +296,7 @@ detach(Client **head, Client *c)
* \param awesomeconf awesome config * \param awesomeconf awesome config
*/ */
void void
focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf) focus(Client * c, Bool selscreen, awesome_config *awesomeconf)
{ {
/* if c is NULL or invisible, take next client in the stack */ /* if c is NULL or invisible, take next client in the stack */
if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags))) if((!c && selscreen) || (c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags)))
@ -333,7 +333,7 @@ focus(Display *disp, Client * c, Bool selscreen, awesome_config *awesomeconf)
setclienttrans(*awesomeconf->client_sel, -1); setclienttrans(*awesomeconf->client_sel, -1);
} }
else else
XSetInputFocus(disp, RootWindow(disp, awesomeconf->phys_screen), RevertToPointerRoot, CurrentTime); XSetInputFocus(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), RevertToPointerRoot, CurrentTime);
} }
@ -566,7 +566,7 @@ unmanage(Client * c, long state, awesome_config *awesomeconf)
XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */ XConfigureWindow(c->display, c->win, CWBorderWidth, &wc); /* restore border */
detach(awesomeconf->clients, c); detach(awesomeconf->clients, c);
if(*awesomeconf->client_sel == c) if(*awesomeconf->client_sel == c)
focus(c->display, NULL, True, awesomeconf); focus(NULL, True, awesomeconf);
XUngrabButton(c->display, AnyButton, AnyModifier, c->win); XUngrabButton(c->display, AnyButton, AnyModifier, c->win);
setclientstate(c, state); setclientstate(c, state);
XSync(c->display, False); XSync(c->display, False);

View File

@ -33,7 +33,7 @@ inline void attach(Client **, Client *);
inline void detach(Client **, Client *); inline void detach(Client **, Client *);
void ban(Client *); /* bans c */ void ban(Client *); /* bans c */
void configure(Client *); /* send synthetic configure event */ void configure(Client *); /* send synthetic configure event */
void focus(Display *, Client *, Bool, awesome_config *); /* focus c if visible && !NULL, or focus top visible */ void focus(Client *, Bool, awesome_config *);
void manage(Display *, Window, XWindowAttributes *, awesome_config *); void manage(Display *, Window, XWindowAttributes *, awesome_config *);
void resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */ void resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */
void unban(Client *); /* unbans c */ void unban(Client *); /* unbans c */

View File

@ -197,7 +197,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if((c = get_client_bywin(awesomeconf->clients, ev->window))) if((c = get_client_bywin(awesomeconf->clients, ev->window)))
{ {
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]); focus(c, ev->same_screen, &awesomeconf[c->screen]);
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey) if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey)
{ {
if (ev->button == Button1) if (ev->button == Button1)
@ -355,7 +355,7 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
{ {
if(!*awesomeconf->client_sel || *awesomeconf->client_sel != c) if(!*awesomeconf->client_sel || *awesomeconf->client_sel != c)
{ {
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]); focus(c, ev->same_screen, &awesomeconf[c->screen]);
if (*awesomeconf->client_sel && ((*awesomeconf->client_sel)->isfloating || IS_ARRANGE((*awesomeconf->client_sel)->screen, layout_floating))) if (*awesomeconf->client_sel && ((*awesomeconf->client_sel)->isfloating || IS_ARRANGE((*awesomeconf->client_sel)->screen, layout_floating)))
grabbuttons(*awesomeconf->client_sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask); grabbuttons(*awesomeconf->client_sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask);
} }
@ -363,7 +363,7 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
else else
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
if(ev->window == RootWindow(e->xany.display, screen)) if(ev->window == RootWindow(e->xany.display, screen))
focus(e->xany.display, NULL, True, &awesomeconf[screen]); focus(NULL, True, &awesomeconf[screen]);
} }
void void
@ -416,7 +416,7 @@ handle_event_leavenotify(XEvent * e, awesome_config *awesomeconf)
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
if((ev->window == RootWindow(e->xany.display, screen)) && !ev->same_screen) if((ev->window == RootWindow(e->xany.display, screen)) && !ev->same_screen)
focus(e->xany.display, NULL, ev->same_screen, &awesomeconf[screen]); focus(NULL, ev->same_screen, &awesomeconf[screen]);
} }
void void

View File

@ -47,7 +47,7 @@ arrange(awesome_config *awesomeconf)
ban(c); ban(c);
} }
awesomeconf->current_layout->arrange(awesomeconf); awesomeconf->current_layout->arrange(awesomeconf);
focus(awesomeconf->display, NULL, True, awesomeconf); focus(NULL, True, awesomeconf);
restack(awesomeconf->display, awesomeconf); restack(awesomeconf->display, awesomeconf);
} }
@ -64,7 +64,7 @@ uicb_focusnext(awesome_config * awesomeconf,
for(c = *awesomeconf->clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->next); for(c = *awesomeconf->clients; c && !isvisible(c, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); c = c->next);
if(c) if(c)
{ {
focus(c->display, c, True, awesomeconf); focus(c, True, awesomeconf);
restack(c->display, awesomeconf); restack(c->display, awesomeconf);
} }
} }
@ -85,7 +85,7 @@ uicb_focusprev(awesome_config *awesomeconf,
} }
if(c) if(c)
{ {
focus(c->display, c, True, awesomeconf); focus(c, True, awesomeconf);
restack(c->display, awesomeconf); restack(c->display, awesomeconf);
} }
} }
@ -285,7 +285,7 @@ uicb_zoom(awesome_config *awesomeconf,
return; return;
detach(awesomeconf->clients, *awesomeconf->client_sel); detach(awesomeconf->clients, *awesomeconf->client_sel);
attach(awesomeconf->clients, *awesomeconf->client_sel); attach(awesomeconf->clients, *awesomeconf->client_sel);
focus(awesomeconf->display, *awesomeconf->client_sel, True, awesomeconf); focus(*awesomeconf->client_sel, True, awesomeconf);
arrange(awesomeconf); arrange(awesomeconf);
} }

View File

@ -197,7 +197,7 @@ uicb_focusnextscreen(awesome_config * awesomeconf,
for(c = *awesomeconf->clients; c && !isvisible(c, next_screen, awesomeconf[next_screen - awesomeconf->screen].tags, awesomeconf[next_screen - awesomeconf->screen].ntags); c = c->next); for(c = *awesomeconf->clients; c && !isvisible(c, next_screen, awesomeconf[next_screen - awesomeconf->screen].tags, awesomeconf[next_screen - awesomeconf->screen].ntags); c = c->next);
if(c) if(c)
{ {
focus(c->display, c, True, &awesomeconf[next_screen - awesomeconf->screen]); focus(c, True, &awesomeconf[next_screen - awesomeconf->screen]);
restack(c->display, &awesomeconf[next_screen - awesomeconf->screen]); restack(c->display, &awesomeconf[next_screen - awesomeconf->screen]);
} }
move_mouse_pointer_to_screen(awesomeconf->display, next_screen); move_mouse_pointer_to_screen(awesomeconf->display, next_screen);
@ -213,7 +213,7 @@ uicb_focusprevscreen(awesome_config * awesomeconf,
for(c = *awesomeconf->clients; c && !isvisible(c, prev_screen, awesomeconf[prev_screen - awesomeconf->screen].tags, awesomeconf[prev_screen - awesomeconf->screen].ntags); c = c->next); for(c = *awesomeconf->clients; c && !isvisible(c, prev_screen, awesomeconf[prev_screen - awesomeconf->screen].tags, awesomeconf[prev_screen - awesomeconf->screen].ntags); c = c->next);
if(c) if(c)
{ {
focus(c->display, c, True, &awesomeconf[prev_screen - awesomeconf->screen]); focus(c, True, &awesomeconf[prev_screen - awesomeconf->screen]);
restack(c->display, &awesomeconf[prev_screen - awesomeconf->screen]); restack(c->display, &awesomeconf[prev_screen - awesomeconf->screen]);
} }
move_mouse_pointer_to_screen(awesomeconf->display, prev_screen); move_mouse_pointer_to_screen(awesomeconf->display, prev_screen);

8
tab.c
View File

@ -86,7 +86,7 @@ uicb_tab(awesome_config *awesomeconf,
c->tab.isvisible = False; c->tab.isvisible = False;
arrange(awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel, True, awesomeconf); focus(sel, True, awesomeconf);
} }
} }
@ -101,7 +101,7 @@ uicb_untab(awesome_config *awesomeconf,
client_untab(sel); client_untab(sel);
arrange(awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel, True, awesomeconf); focus(sel, True, awesomeconf);
} }
void void
@ -116,7 +116,7 @@ uicb_viewnexttab(awesome_config *awesomeconf,
sel->tab.isvisible = False; sel->tab.isvisible = False;
sel->tab.next->tab.isvisible = True; sel->tab.next->tab.isvisible = True;
arrange(awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel->tab.next, True, awesomeconf); focus(sel->tab.next, True, awesomeconf);
} }
void void
@ -131,7 +131,7 @@ uicb_viewprevtab(awesome_config *awesomeconf,
sel->tab.isvisible = False; sel->tab.isvisible = False;
sel->tab.prev->tab.isvisible = True; sel->tab.prev->tab.isvisible = True;
arrange(awesomeconf); arrange(awesomeconf);
focus(awesomeconf->display, sel->tab.prev, True, awesomeconf); focus(sel->tab.prev, True, awesomeconf);
} }
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99