make uicb_screen_focus{prev,next} honor tag->client_sel

This commit is contained in:
Julien Danjou 2007-11-21 17:18:42 +01:00
parent 3f8bff5bef
commit 226d718634
1 changed files with 6 additions and 14 deletions

View File

@ -227,15 +227,11 @@ void
uicb_screen_focusnext(awesome_config * awesomeconf,
const char *arg __attribute__ ((unused)))
{
Client *c;
int next_screen = awesomeconf->screen + 1 >= get_screen_count(awesomeconf->display) ? 0 : awesomeconf->screen + 1;
Client *sel = get_current_tag(awesomeconf[next_screen - awesomeconf->screen].tags,
awesomeconf[next_screen - awesomeconf->screen].ntags)->client_sel;
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, True, &awesomeconf[next_screen - awesomeconf->screen]);
restack(&awesomeconf[next_screen - awesomeconf->screen]);
}
focus(sel, True, &awesomeconf[next_screen - awesomeconf->screen]);
move_mouse_pointer_to_screen(awesomeconf->display, next_screen);
}
@ -243,15 +239,11 @@ void
uicb_screen_focusprev(awesome_config * awesomeconf,
const char *arg __attribute__ ((unused)))
{
Client *c;
int prev_screen = awesomeconf->screen - 1 < 0 ? get_screen_count(awesomeconf->display) - 1 : awesomeconf->screen - 1;
Client *sel = get_current_tag(awesomeconf[prev_screen - awesomeconf->screen].tags,
awesomeconf[prev_screen - awesomeconf->screen].ntags)->client_sel;
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, True, &awesomeconf[prev_screen - awesomeconf->screen]);
restack(&awesomeconf[prev_screen - awesomeconf->screen]);
}
focus(sel, True, &awesomeconf[prev_screen - awesomeconf->screen]);
move_mouse_pointer_to_screen(awesomeconf->display, prev_screen);
}