mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
bugfix: restore focus after swapprev/next
This commit is contained in:
parent
035bf83f59
commit
00ddb9d398
1 changed files with 10 additions and 6 deletions
16
client.c
16
client.c
|
@ -725,16 +725,18 @@ void
|
|||
uicb_swapnext(awesome_config *awesomeconf,
|
||||
const char *arg __attribute__ ((unused)))
|
||||
{
|
||||
Client *next;
|
||||
Client *next, *sel = *awesomeconf->client_sel;
|
||||
|
||||
if(!*awesomeconf->client_sel)
|
||||
if(!sel)
|
||||
return;
|
||||
|
||||
for(next = (*awesomeconf->client_sel)->next; next && !isvisible(next, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); next = next->next);
|
||||
for(next = sel->next; next && !isvisible(next, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); next = next->next);
|
||||
if(next)
|
||||
{
|
||||
client_swap(awesomeconf->clients, *awesomeconf->client_sel, next);
|
||||
arrange(awesomeconf);
|
||||
/* restore focus */
|
||||
focus(sel, True, awesomeconf);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -742,16 +744,18 @@ void
|
|||
uicb_swapprev(awesome_config *awesomeconf,
|
||||
const char *arg __attribute__ ((unused)))
|
||||
{
|
||||
Client *prev;
|
||||
Client *prev, *sel = *awesomeconf->client_sel;
|
||||
|
||||
if(!*awesomeconf->client_sel)
|
||||
if(!sel)
|
||||
return;
|
||||
|
||||
for(prev = (*awesomeconf->client_sel)->prev; prev && !isvisible(prev, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); prev = prev->prev);
|
||||
for(prev = sel->prev; prev && !isvisible(prev, awesomeconf->screen, awesomeconf->tags, awesomeconf->ntags); prev = prev->prev);
|
||||
if(prev)
|
||||
{
|
||||
client_swap(awesomeconf->clients, prev, *awesomeconf->client_sel);
|
||||
arrange(awesomeconf);
|
||||
/* restore focus */
|
||||
focus(sel, True, awesomeconf);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue