mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-06-16 08:15:40 +02:00
exposable: add ‘btn’ argument to on_mouse()
This commit is contained in:
parent
8f7ef7c20b
commit
dd724d1bc2
11 changed files with 69 additions and 38 deletions
|
@ -151,7 +151,8 @@ set_cursor(struct bar *bar, const char *cursor)
|
|||
}
|
||||
|
||||
static void
|
||||
on_mouse(struct bar *_bar, enum mouse_event event, int x, int y)
|
||||
on_mouse(struct bar *_bar, enum mouse_event event, enum mouse_button btn,
|
||||
int x, int y)
|
||||
{
|
||||
struct private *bar = _bar->private;
|
||||
|
||||
|
@ -173,7 +174,7 @@ on_mouse(struct bar *_bar, enum mouse_event event, int x, int y)
|
|||
mx += bar->left_spacing;
|
||||
if (x >= mx && x < mx + e->width) {
|
||||
if (e->on_mouse != NULL)
|
||||
e->on_mouse(e, _bar, event, x - mx, y);
|
||||
e->on_mouse(e, _bar, event, btn, x - mx, y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,7 +188,7 @@ on_mouse(struct bar *_bar, enum mouse_event event, int x, int y)
|
|||
mx += bar->left_spacing;
|
||||
if (x >= mx && x < mx + e->width) {
|
||||
if (e->on_mouse != NULL)
|
||||
e->on_mouse(e, _bar, event, x - mx, y);
|
||||
e->on_mouse(e, _bar, event, btn, x - mx, y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -205,7 +206,7 @@ on_mouse(struct bar *_bar, enum mouse_event event, int x, int y)
|
|||
mx += bar->left_spacing;
|
||||
if (x >= mx && x < mx + e->width) {
|
||||
if (e->on_mouse != NULL)
|
||||
e->on_mouse(e, _bar, event, x - mx, y);
|
||||
e->on_mouse(e, _bar, event, btn, x - mx, y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue