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();
|
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
|
/** Get a client name
|
||||||
* \param c struct client pointer
|
* \param c struct client pointer
|
||||||
*/
|
*/
|
||||||
@ -681,26 +692,6 @@ client_get_sizeh(struct client *c)
|
|||||||
c->flags |= CLIENT_HINT_FLAG;
|
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
|
static void
|
||||||
client_frame_new(struct client *c)
|
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(struct client *c, struct client *cm);
|
||||||
void client_tab_focus(struct client *c);
|
void client_tab_focus(struct client *c);
|
||||||
void client_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_get_name(struct client *c);
|
||||||
void client_close(struct client *c);
|
void client_close(struct client *c);
|
||||||
void uicb_client_close(Uicb cmd);
|
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_untab", uicb_client_untab },
|
||||||
{ "client_focus_next_tab", uicb_client_focus_next_tab },
|
{ "client_focus_next_tab", uicb_client_focus_next_tab },
|
||||||
{ "client_focus_prev_tab", uicb_client_focus_prev_tab },
|
{ "client_focus_prev_tab", uicb_client_focus_prev_tab },
|
||||||
|
{ "client_focus_click", uicb_client_focus_click },
|
||||||
|
|
||||||
/* Status */
|
/* Status */
|
||||||
{ "status" , uicb_status },
|
{ "status" , uicb_status },
|
||||||
|
|||||||
1
wmfsrc
1
wmfsrc
@ -89,6 +89,7 @@
|
|||||||
|
|
||||||
[client]
|
[client]
|
||||||
|
|
||||||
|
[mouse] button = "1" func = "client_focus_click" [/mouse]
|
||||||
[mouse] button = "1" func = "mouse_swap" [/mouse]
|
[mouse] button = "1" func = "mouse_swap" [/mouse]
|
||||||
[mouse] button = "2" func = "mouse_tab" [/mouse]
|
[mouse] button = "2" func = "mouse_tab" [/mouse]
|
||||||
[mouse] button = "3" func = "mouse_resize" [/mouse]
|
[mouse] button = "3" func = "mouse_resize" [/mouse]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user