Add client_focus_click uicb, by default with button1 on client
This commit is contained in:
parent
dbac129bf9
commit
ade67b66ee
31
src/client.c
31
src/client.c
@ -553,6 +553,17 @@ client_focus(struct client *c)
|
||||
ewmh_update_wmfs_props();
|
||||
}
|
||||
|
||||
void
|
||||
uicb_client_focus_click(Uicb cmd)
|
||||
{
|
||||
(void)cmd;
|
||||
struct client *c;
|
||||
|
||||
if((c = client_gb_titlebar(W->last_clicked_barwin->win))
|
||||
|| (c = client_gb_frame(W->last_clicked_barwin->win)))
|
||||
client_focus(c);
|
||||
}
|
||||
|
||||
/** Get a client name
|
||||
* \param c struct client pointer
|
||||
*/
|
||||
@ -681,26 +692,6 @@ client_get_sizeh(struct client *c)
|
||||
c->flags |= CLIENT_HINT_FLAG;
|
||||
}
|
||||
|
||||
/* Window id (unsigned int) is casted in Uicb type (char*) and restored */
|
||||
void
|
||||
uicb_client_focus_with_wid(Uicb cmd)
|
||||
{
|
||||
struct client *c;
|
||||
size_t i;
|
||||
Window id = 0;
|
||||
|
||||
/* Re-build window id from cmd string */
|
||||
for(i = 0; i < sizeof(Window); ++i)
|
||||
((char*)&id)[i] = cmd[i];
|
||||
|
||||
SLIST_FOREACH(c, &W->h.client, next)
|
||||
if(c->win == id)
|
||||
{
|
||||
client_focus(c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
client_frame_new(struct client *c)
|
||||
{
|
||||
|
||||
@ -27,6 +27,7 @@ void client_tab_pull(struct client *c);
|
||||
void _client_tab(struct client *c, struct client *cm);
|
||||
void client_tab_focus(struct client *c);
|
||||
void client_focus(struct client *c);
|
||||
void uicb_client_focus_click(Uicb);
|
||||
void client_get_name(struct client *c);
|
||||
void client_close(struct client *c);
|
||||
void uicb_client_close(Uicb cmd);
|
||||
|
||||
@ -70,6 +70,7 @@ static const struct { char *name; void (*func)(Uicb cmd); } uicb_list[] =
|
||||
{ "client_untab", uicb_client_untab },
|
||||
{ "client_focus_next_tab", uicb_client_focus_next_tab },
|
||||
{ "client_focus_prev_tab", uicb_client_focus_prev_tab },
|
||||
{ "client_focus_click", uicb_client_focus_click },
|
||||
|
||||
/* Status */
|
||||
{ "status" , uicb_status },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user