From 0026bd38132b5829966715ec94a944c5710b7296 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 15 Oct 2007 18:25:29 +0200 Subject: [PATCH] focus does not need Display as arg --- client.c | 6 +++--- client.h | 2 +- event.c | 8 ++++---- layout.c | 8 ++++---- screen.c | 4 ++-- tab.c | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client.c b/client.c index 4f457780..48252ee7 100644 --- a/client.c +++ b/client.c @@ -296,7 +296,7 @@ detach(Client **head, Client *c) * \param awesomeconf awesome config */ 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 && 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); } 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 */ detach(awesomeconf->clients, c); if(*awesomeconf->client_sel == c) - focus(c->display, NULL, True, awesomeconf); + focus(NULL, True, awesomeconf); XUngrabButton(c->display, AnyButton, AnyModifier, c->win); setclientstate(c, state); XSync(c->display, False); diff --git a/client.h b/client.h index 074d2663..9e31de77 100644 --- a/client.h +++ b/client.h @@ -33,7 +33,7 @@ inline void attach(Client **, Client *); inline void detach(Client **, Client *); void ban(Client *); /* bans c */ 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 resize(Client *, int, int, int, int, awesome_config *, Bool); /* resize with given coordinates c */ void unban(Client *); /* unbans c */ diff --git a/event.c b/event.c index 82f5c826..8fd2cadb 100644 --- a/event.c +++ b/event.c @@ -197,7 +197,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) 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 (ev->button == Button1) @@ -355,7 +355,7 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf) { 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))) grabbuttons(*awesomeconf->client_sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask); } @@ -363,7 +363,7 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf) else for(screen = 0; screen < ScreenCount(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 @@ -416,7 +416,7 @@ handle_event_leavenotify(XEvent * e, awesome_config *awesomeconf) for(screen = 0; screen < ScreenCount(e->xany.display); 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 diff --git a/layout.c b/layout.c index 2e781dbb..6ed80a9e 100644 --- a/layout.c +++ b/layout.c @@ -47,7 +47,7 @@ arrange(awesome_config *awesomeconf) ban(c); } awesomeconf->current_layout->arrange(awesomeconf); - focus(awesomeconf->display, NULL, True, awesomeconf); + focus(NULL, True, 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); if(c) { - focus(c->display, c, True, awesomeconf); + focus(c, True, awesomeconf); restack(c->display, awesomeconf); } } @@ -85,7 +85,7 @@ uicb_focusprev(awesome_config *awesomeconf, } if(c) { - focus(c->display, c, True, awesomeconf); + focus(c, True, awesomeconf); restack(c->display, awesomeconf); } } @@ -285,7 +285,7 @@ uicb_zoom(awesome_config *awesomeconf, return; detach(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); } diff --git a/screen.c b/screen.c index 6c49e71f..4d1e9130 100644 --- a/screen.c +++ b/screen.c @@ -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); 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]); } 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); 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]); } move_mouse_pointer_to_screen(awesomeconf->display, prev_screen); diff --git a/tab.c b/tab.c index 30fe0464..fc226004 100644 --- a/tab.c +++ b/tab.c @@ -86,7 +86,7 @@ uicb_tab(awesome_config *awesomeconf, c->tab.isvisible = False; arrange(awesomeconf); - focus(awesomeconf->display, sel, True, awesomeconf); + focus(sel, True, awesomeconf); } } @@ -101,7 +101,7 @@ uicb_untab(awesome_config *awesomeconf, client_untab(sel); arrange(awesomeconf); - focus(awesomeconf->display, sel, True, awesomeconf); + focus(sel, True, awesomeconf); } void @@ -116,7 +116,7 @@ uicb_viewnexttab(awesome_config *awesomeconf, sel->tab.isvisible = False; sel->tab.next->tab.isvisible = True; arrange(awesomeconf); - focus(awesomeconf->display, sel->tab.next, True, awesomeconf); + focus(sel->tab.next, True, awesomeconf); } void @@ -131,7 +131,7 @@ uicb_viewprevtab(awesome_config *awesomeconf, sel->tab.isvisible = False; sel->tab.prev->tab.isvisible = True; 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