feat: Window click handlers
New parameters for defining fallback click handlers that will be triggered for the whole window unless a module action is matched. Parameters added to all [bar/foo] sections: - `click-left = ...` - `click-middle= ...` - `click-right= ...` - `scroll-up= ...` - `scroll-down= ...` Ref #226
This commit is contained in:
parent
3854515521
commit
ec39859093
5 changed files with 81 additions and 29 deletions
include/components
|
@ -73,6 +73,22 @@ struct line_settings {
|
|||
uint16_t size{0U};
|
||||
};
|
||||
|
||||
struct action {
|
||||
mousebtn button{mousebtn::NONE};
|
||||
string command;
|
||||
};
|
||||
|
||||
struct action_block : public action {
|
||||
alignment align{alignment::NONE};
|
||||
double start_x{0.0};
|
||||
double end_x{0.0};
|
||||
bool active{true};
|
||||
|
||||
uint16_t width() const {
|
||||
return static_cast<uint16_t>(end_x - start_x + 0.5);
|
||||
}
|
||||
};
|
||||
|
||||
struct bar_settings {
|
||||
monitor_t monitor;
|
||||
edge origin{edge::TOP};
|
||||
|
@ -103,6 +119,8 @@ struct bar_settings {
|
|||
|
||||
bool override_redirect{false};
|
||||
|
||||
vector<action> actions;
|
||||
|
||||
const xcb_rectangle_t inner_area(bool abspos = false) const {
|
||||
xcb_rectangle_t rect{0, 0, size.w, size.h};
|
||||
|
||||
|
@ -121,19 +139,6 @@ struct bar_settings {
|
|||
}
|
||||
};
|
||||
|
||||
struct action_block {
|
||||
alignment align{alignment::NONE};
|
||||
double start_x{0.0};
|
||||
double end_x{0.0};
|
||||
mousebtn button{mousebtn::NONE};
|
||||
string command;
|
||||
bool active{true};
|
||||
|
||||
uint16_t width() const {
|
||||
return static_cast<uint16_t>(end_x - start_x + 0.5);
|
||||
}
|
||||
};
|
||||
|
||||
struct event_timer {
|
||||
xcb_timestamp_t event{0L};
|
||||
xcb_timestamp_t offset{1L};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue