remove selscreen arg

This commit is contained in:
Julien Danjou 2008-01-24 23:48:35 +01:00
parent 5ade4d63e0
commit 3855ced402
7 changed files with 17 additions and 21 deletions

View File

@ -156,11 +156,10 @@ client_ban(Client * c)
/** Give focus to client, or to first client if c is NULL /** Give focus to client, or to first client if c is NULL
* \param c client * \param c client
* \param selscreen True if current screen is selected
* \param screen Screen ID * \param screen Screen ID
*/ */
void void
focus(Client *c, Bool selscreen, int screen) focus(Client *c, int screen)
{ {
int phys_screen = get_phys_screen(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 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); c = focus_get_current_client(screen);
/* if c is still NULL take next client in the stack */ /* 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); window_grabbuttons(phys_screen, c->win, True, True);
} }
if(!selscreen)
return;
/* save sel in focus history */ /* save sel in focus history */
focus_add_client(c); focus_add_client(c);
@ -323,7 +319,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen)
/* focus ? */ /* focus ? */
if(globalconf.screens[c->screen].new_get_focus) if(globalconf.screens[c->screen].new_get_focus)
focus(c, True, c->screen); focus(c, c->screen);
/* some windows require this */ /* some windows require this */
XMoveResizeWindow(globalconf.display, c->win, c->geometry.x, c->geometry.y, XMoveResizeWindow(globalconf.display, c->win, c->geometry.x, c->geometry.y,
@ -508,7 +504,7 @@ client_unmanage(Client *c)
untag_client(c, tag); untag_client(c, tag);
if(globalconf.focus->client == c) if(globalconf.focus->client == c)
focus(NULL, True, c->screen); focus(NULL, c->screen);
XUngrabButton(globalconf.display, AnyButton, AnyModifier, c->win); XUngrabButton(globalconf.display, AnyButton, AnyModifier, c->win);
window_setstate(c->win, WithdrawnState); window_setstate(c->win, WithdrawnState);
@ -952,7 +948,7 @@ uicb_client_focusnext(int screen, char *arg __attribute__ ((unused)))
if(!c) if(!c)
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next); for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(c) if(c)
focus(c, True, screen); focus(c, screen);
} }
/** Send focus to previous client in stack /** Send focus to previous client in stack
@ -966,7 +962,7 @@ uicb_client_focusprev(int screen, char *arg __attribute__ ((unused)))
Client *prev; Client *prev;
if((prev = client_find_prev_visible(globalconf.focus->client))) if((prev = client_find_prev_visible(globalconf.focus->client)))
focus(prev, True, screen); focus(prev, screen);
} }
/** Toggle floating state of a client /** Toggle floating state of a client

View File

@ -27,7 +27,7 @@
Bool client_isvisible(Client *, int); Bool client_isvisible(Client *, int);
Client * get_client_bywin(Client *, Window); Client * get_client_bywin(Client *, Window);
Client * get_client_byname(Client *, char *); Client * get_client_byname(Client *, char *);
void focus(Client *, Bool, int); void focus(Client *, int);
void client_ban(Client *); void client_ban(Client *);
void client_unban(Client *); void client_unban(Client *);
void client_manage(Window, XWindowAttributes *, int); void client_manage(Window, XWindowAttributes *, int);

View File

@ -117,7 +117,7 @@ handle_event_buttonpress(XEvent *e)
if((c = get_client_bywin(globalconf.clients, ev->window))) 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 if(CLEANMASK(ev->state) == NoSymbol
&& ev->button == Button1) && ev->button == Button1)
{ {
@ -242,7 +242,7 @@ handle_event_enternotify(XEvent * e)
&& globalconf.screens[c->screen].sloppy_focus && globalconf.screens[c->screen].sloppy_focus
&& c != globalconf.focus->client) && c != globalconf.focus->client)
{ {
focus(c, ev->same_screen, c->screen); focus(c, c->screen);
curtags = get_current_tags(c->screen); curtags = get_current_tags(c->screen);
if (c->isfloating || curtags[0]->layout->arrange == layout_floating) if (c->isfloating || curtags[0]->layout->arrange == layout_floating)
window_grabbuttons(get_phys_screen(c->screen), c->win, True, False); 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++) 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(NULL, ev->same_screen, screen); focus(NULL, screen);
if((c = globalconf.focus->client)) if((c = globalconf.focus->client))
window_grabbuttons(c->screen, c->win, False, False); 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++) 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(NULL, ev->same_screen, screen); focus(NULL, screen);
} }
void void

View File

@ -120,7 +120,7 @@ uicb_focus_history(int screen, char *arg)
c = focus_get_latest_client_for_tags(curtags, i); c = focus_get_latest_client_for_tags(curtags, i);
p_delete(&curtags); p_delete(&curtags);
if(c) 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))) if((c = get_client_byname(globalconf.clients, arg)))
for(tag = curtags; *tag; tag++) for(tag = curtags; *tag; tag++)
if(is_client_tagged(c, *tag)) if(is_client_tagged(c, *tag))
focus(c, True, screen); focus(c, screen);
p_delete(&curtags); p_delete(&curtags);
} }
} }

View File

@ -83,7 +83,7 @@ arrange(int screen)
layout_raise_floatings(screen); layout_raise_floatings(screen);
c = focus_get_current_client(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)), if(c && XQueryPointer(globalconf.display, RootWindow(globalconf.display, get_phys_screen(screen)),
&root_win, &client_win, &x, &y, &d, &d, &m) && &root_win, &client_win, &x, &y, &d, &d, &m) &&
(root_win == None || client_win == None || client_win == root_win)) (root_win == None || client_win == None || client_win == root_win))

View File

@ -353,7 +353,7 @@ uicb_screen_focus(int screen, char *arg)
if (new_screen > (globalconf.nscreen - 1)) if (new_screen > (globalconf.nscreen - 1))
new_screen = 0; 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); move_mouse_pointer_to_screen(new_screen);
} }
@ -385,6 +385,6 @@ uicb_client_movetoscreen(int screen __attribute__ ((unused)), char *arg)
prev_screen = sel->screen; prev_screen = sel->screen;
move_client_to_screen(sel, new_screen, True); move_client_to_screen(sel, new_screen, True);
move_mouse_pointer_to_screen(new_screen); 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 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -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++) for(i = 0, tag = globalconf.screens[c->screen].tags; tag; tag = tag->next, i++)
if(is_client_tagged(c, tag)) if(is_client_tagged(c, tag))
tag_view_only_byindex(c->screen, i); tag_view_only_byindex(c->screen, i);
focus(c, True, widget->statusbar->screen); focus(c, widget->statusbar->screen);
} }
return; return;