Client/Tag: Fix focus problems with tag_transfert
This commit is contained in:
34
src/client.c
34
src/client.c
@@ -1091,13 +1091,34 @@ client_unhide(Client *c)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Select next or previous client to don't lose focus
|
||||||
|
* \param c Client pointer
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
client_focus_next(Client *c)
|
||||||
|
{
|
||||||
|
Client *c_next = NULL;
|
||||||
|
|
||||||
|
for(c_next = clients;
|
||||||
|
c_next && c_next != c->prev
|
||||||
|
&& c_next->tag != c->tag
|
||||||
|
&& c_next->screen != c->screen;
|
||||||
|
c_next = c_next->next);
|
||||||
|
|
||||||
|
if(c_next && c_next->tag == seltag[selscreen]
|
||||||
|
&& c_next->screen == selscreen)
|
||||||
|
client_focus(c_next);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Unmanage a client
|
/** Unmanage a client
|
||||||
* \param c Client pointer
|
* \param c Client pointer
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
client_unmanage(Client *c)
|
client_unmanage(Client *c)
|
||||||
{
|
{
|
||||||
Client *c_next = NULL;
|
|
||||||
Bool b = False;
|
Bool b = False;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -1134,16 +1155,7 @@ client_unmanage(Client *c)
|
|||||||
|
|
||||||
XFree(c->title);
|
XFree(c->title);
|
||||||
|
|
||||||
/* To focus the previous client */
|
client_focus_next(c);
|
||||||
for(c_next = clients;
|
|
||||||
c_next && c_next != c->prev
|
|
||||||
&& c_next->tag != c->tag
|
|
||||||
&& c_next->screen != c->screen;
|
|
||||||
c_next = c_next->next);
|
|
||||||
|
|
||||||
if(c_next && c_next->tag == seltag[selscreen]
|
|
||||||
&& c_next->screen == selscreen)
|
|
||||||
client_focus(c_next);
|
|
||||||
|
|
||||||
free(c);
|
free(c);
|
||||||
|
|
||||||
|
|||||||
@@ -137,8 +137,7 @@ tag_transfert(Client *c, int tag)
|
|||||||
|
|
||||||
arrange(c->screen, True);
|
arrange(c->screen, True);
|
||||||
|
|
||||||
if(c == sel && c->tag != tag)
|
client_focus_next(c);
|
||||||
client_focus(NULL);
|
|
||||||
|
|
||||||
client_update_attributes(c);
|
client_update_attributes(c);
|
||||||
|
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ void client_size_hints(Client *c);
|
|||||||
void client_swap(Client *c1, Client *c2);
|
void client_swap(Client *c1, Client *c2);
|
||||||
void client_raise(Client *c);
|
void client_raise(Client *c);
|
||||||
void client_unhide(Client *c);
|
void client_unhide(Client *c);
|
||||||
|
void client_focus_next(Client *c);
|
||||||
void client_unmanage(Client *c);
|
void client_unmanage(Client *c);
|
||||||
void client_unmap(Client *c);
|
void client_unmap(Client *c);
|
||||||
void client_set_rules(Client *c);
|
void client_set_rules(Client *c);
|
||||||
|
|||||||
Reference in New Issue
Block a user