From 3855ced4027144f41040422b92f4f4cfb3350bd0 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 24 Jan 2008 23:48:35 +0100 Subject: [PATCH] remove selscreen arg --- client.c | 16 ++++++---------- client.h | 2 +- event.c | 8 ++++---- focus.c | 4 ++-- layout.c | 2 +- screen.c | 4 ++-- widgets/tasklist.c | 2 +- 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/client.c b/client.c index 04f92757..f5016d8a 100644 --- a/client.c +++ b/client.c @@ -156,11 +156,10 @@ client_ban(Client * c) /** Give focus to client, or to first client if c is NULL * \param c client - * \param selscreen True if current screen is selected * \param screen Screen ID */ void -focus(Client *c, Bool selscreen, int screen) +focus(Client *c, int screen) { int phys_screen = get_phys_screen(screen); @@ -176,7 +175,7 @@ focus(Client *c, Bool selscreen, int screen) /* if c is NULL or invisible, take next client in the focus history */ - if((!c && selscreen) || (c && !client_isvisible(c, screen))) + if(!c || (c && !client_isvisible(c, screen))) { c = focus_get_current_client(screen); /* if c is still NULL take next client in the stack */ @@ -190,9 +189,6 @@ focus(Client *c, Bool selscreen, int screen) window_grabbuttons(phys_screen, c->win, True, True); } - if(!selscreen) - return; - /* save sel in focus history */ focus_add_client(c); @@ -323,7 +319,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen) /* focus ? */ if(globalconf.screens[c->screen].new_get_focus) - focus(c, True, c->screen); + focus(c, c->screen); /* some windows require this */ XMoveResizeWindow(globalconf.display, c->win, c->geometry.x, c->geometry.y, @@ -508,7 +504,7 @@ client_unmanage(Client *c) untag_client(c, tag); if(globalconf.focus->client == c) - focus(NULL, True, c->screen); + focus(NULL, c->screen); XUngrabButton(globalconf.display, AnyButton, AnyModifier, c->win); window_setstate(c->win, WithdrawnState); @@ -952,7 +948,7 @@ uicb_client_focusnext(int screen, char *arg __attribute__ ((unused))) if(!c) for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next); if(c) - focus(c, True, screen); + focus(c, screen); } /** Send focus to previous client in stack @@ -966,7 +962,7 @@ uicb_client_focusprev(int screen, char *arg __attribute__ ((unused))) Client *prev; if((prev = client_find_prev_visible(globalconf.focus->client))) - focus(prev, True, screen); + focus(prev, screen); } /** Toggle floating state of a client diff --git a/client.h b/client.h index d29a257c..931a09e4 100644 --- a/client.h +++ b/client.h @@ -27,7 +27,7 @@ Bool client_isvisible(Client *, int); Client * get_client_bywin(Client *, Window); Client * get_client_byname(Client *, char *); -void focus(Client *, Bool, int); +void focus(Client *, int); void client_ban(Client *); void client_unban(Client *); void client_manage(Window, XWindowAttributes *, int); diff --git a/event.c b/event.c index bdeb76c8..543e8dbb 100644 --- a/event.c +++ b/event.c @@ -117,7 +117,7 @@ handle_event_buttonpress(XEvent *e) if((c = get_client_bywin(globalconf.clients, ev->window))) { - focus(c, ev->same_screen, c->screen); + focus(c, c->screen); if(CLEANMASK(ev->state) == NoSymbol && ev->button == Button1) { @@ -242,7 +242,7 @@ handle_event_enternotify(XEvent * e) && globalconf.screens[c->screen].sloppy_focus && c != globalconf.focus->client) { - focus(c, ev->same_screen, c->screen); + focus(c, c->screen); curtags = get_current_tags(c->screen); if (c->isfloating || curtags[0]->layout->arrange == layout_floating) window_grabbuttons(get_phys_screen(c->screen), c->win, True, False); @@ -252,7 +252,7 @@ handle_event_enternotify(XEvent * e) { for(screen = 0; screen < ScreenCount(e->xany.display); screen++) if(ev->window == RootWindow(e->xany.display, screen)) - focus(NULL, ev->same_screen, screen); + focus(NULL, screen); if((c = globalconf.focus->client)) window_grabbuttons(c->screen, c->win, False, False); } @@ -317,7 +317,7 @@ handle_event_leavenotify(XEvent * e) for(screen = 0; screen < ScreenCount(e->xany.display); screen++) if((ev->window == RootWindow(e->xany.display, screen)) && !ev->same_screen) - focus(NULL, ev->same_screen, screen); + focus(NULL, screen); } void diff --git a/focus.c b/focus.c index d3df95a6..3463c019 100644 --- a/focus.c +++ b/focus.c @@ -120,7 +120,7 @@ uicb_focus_history(int screen, char *arg) c = focus_get_latest_client_for_tags(curtags, i); p_delete(&curtags); if(c) - focus(c, True, screen); + focus(c, screen); } } } @@ -137,7 +137,7 @@ uicb_focus_client_byname(int screen, char *arg) if((c = get_client_byname(globalconf.clients, arg))) for(tag = curtags; *tag; tag++) if(is_client_tagged(c, *tag)) - focus(c, True, screen); + focus(c, screen); p_delete(&curtags); } } diff --git a/layout.c b/layout.c index 77c00369..4e11b9c8 100644 --- a/layout.c +++ b/layout.c @@ -83,7 +83,7 @@ arrange(int screen) layout_raise_floatings(screen); c = focus_get_current_client(screen); - focus(c, True, screen); + focus(c, screen); if(c && XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)), &root_win, &client_win, &x, &y, &d, &d, &m) && (root_win == None || client_win == None || client_win == root_win)) diff --git a/screen.c b/screen.c index 98419f27..89194df7 100644 --- a/screen.c +++ b/screen.c @@ -353,7 +353,7 @@ uicb_screen_focus(int screen, char *arg) if (new_screen > (globalconf.nscreen - 1)) new_screen = 0; - focus(focus_get_current_client(new_screen), True, new_screen); + focus(focus_get_current_client(new_screen), new_screen); move_mouse_pointer_to_screen(new_screen); } @@ -385,6 +385,6 @@ uicb_client_movetoscreen(int screen __attribute__ ((unused)), char *arg) prev_screen = sel->screen; move_client_to_screen(sel, new_screen, True); move_mouse_pointer_to_screen(new_screen); - focus(sel, True, sel->screen); + focus(sel, sel->screen); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/widgets/tasklist.c b/widgets/tasklist.c index 16380709..350dea6f 100644 --- a/widgets/tasklist.c +++ b/widgets/tasklist.c @@ -210,7 +210,7 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev) for(i = 0, tag = globalconf.screens[c->screen].tags; tag; tag = tag->next, i++) if(is_client_tagged(c, tag)) tag_view_only_byindex(c->screen, i); - focus(c, True, widget->statusbar->screen); + focus(c, widget->statusbar->screen); } return;