Add support for mouse bindings on titlebars
This commit is contained in:
parent
393b6e1f88
commit
c496df9fc6
10
awesomerc.in
10
awesomerc.in
|
@ -182,6 +182,16 @@ mouse
|
||||||
button = "3"
|
button = "3"
|
||||||
command = "client_resizemouse"
|
command = "client_resizemouse"
|
||||||
}
|
}
|
||||||
|
titlebar
|
||||||
|
{
|
||||||
|
button = "1"
|
||||||
|
command = "client_movemouse"
|
||||||
|
}
|
||||||
|
titlebar
|
||||||
|
{
|
||||||
|
button = "3"
|
||||||
|
command = "client_resizemouse"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
keys
|
keys
|
||||||
|
|
|
@ -410,6 +410,7 @@ cfg_opt_t mouse_opts[] =
|
||||||
{
|
{
|
||||||
CFG_SEC((char *) "root", mouse_generic_opts, CFGF_MULTI),
|
CFG_SEC((char *) "root", mouse_generic_opts, CFGF_MULTI),
|
||||||
CFG_SEC((char *) "client", mouse_generic_opts, CFGF_MULTI),
|
CFG_SEC((char *) "client", mouse_generic_opts, CFGF_MULTI),
|
||||||
|
CFG_SEC((char *) "titlebar", mouse_generic_opts, CFGF_MULTI),
|
||||||
CFG_AWESOME_END()
|
CFG_AWESOME_END()
|
||||||
};
|
};
|
||||||
cfg_opt_t menu_opts[] =
|
cfg_opt_t menu_opts[] =
|
||||||
|
|
5
config.c
5
config.c
|
@ -266,7 +266,7 @@ create_widgets(cfg_t* cfg_statusbar, Statusbar *statusbar)
|
||||||
{
|
{
|
||||||
widget = widget_new(statusbar, wptr);
|
widget = widget_new(statusbar, wptr);
|
||||||
widget_list_append(&statusbar->widgets, widget);
|
widget_list_append(&statusbar->widgets, widget);
|
||||||
widget->buttons = parse_mouse_bindings(wptr, "mouse", a_strcmp(cfg_name(wptr), "taglist"));
|
widget->buttons = parse_mouse_bindings(wptr, "mouse", a_strcmp(cfg_name(wptr), "taglist") ? True : False);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
warn("ignoring unknown widget: %s.\n", cfg_name(widgets + i));
|
warn("ignoring unknown widget: %s.\n", cfg_name(widgets + i));
|
||||||
|
@ -534,6 +534,9 @@ config_parse(const char *confpatharg)
|
||||||
/* Mouse: client windows click bindings */
|
/* Mouse: client windows click bindings */
|
||||||
globalconf.buttons.client = parse_mouse_bindings(cfg_mouse, "client", True);
|
globalconf.buttons.client = parse_mouse_bindings(cfg_mouse, "client", True);
|
||||||
|
|
||||||
|
/* Mouse: titlebar windows click bindings */
|
||||||
|
globalconf.buttons.titlebar = parse_mouse_bindings(cfg_mouse, "titlebar", True);
|
||||||
|
|
||||||
/* Keys */
|
/* Keys */
|
||||||
globalconf.numlockmask = get_numlockmask(globalconf.display);
|
globalconf.numlockmask = get_numlockmask(globalconf.display);
|
||||||
|
|
||||||
|
|
5
event.c
5
event.c
|
@ -138,6 +138,10 @@ event_handle_buttonpress(XEvent *e)
|
||||||
event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.client, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
for(c = globalconf.clients; c; c = c->next)
|
||||||
|
if(c->titlebar.sw && c->titlebar.sw->window == ev->window)
|
||||||
|
event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.titlebar, NULL);
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
if(RootWindow(e->xany.display, screen) == ev->window
|
if(RootWindow(e->xany.display, screen) == ev->window
|
||||||
&& XQueryPointer(e->xany.display,
|
&& XQueryPointer(e->xany.display,
|
||||||
|
@ -151,6 +155,7 @@ event_handle_buttonpress(XEvent *e)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Handle XConfigureRequest events
|
/** Handle XConfigureRequest events
|
||||||
* \param e XEvent
|
* \param e XEvent
|
||||||
|
|
Loading…
Reference in New Issue