mirror of
https://github.com/swaywm/sway.git
synced 2026-03-22 05:34:04 -04:00
swaybar: refactor workspace button handling logic
Move the workspace pointer/touch button handling logic from render.c to input.c, and reorganize it so handling more buttons is more natural. No functional change intended. Signed-off-by: Joan Bruguera Micó <joanbrugueram@gmail.com>
This commit is contained in:
parent
c30c451907
commit
39dc37c243
3 changed files with 20 additions and 10 deletions
|
|
@ -236,6 +236,21 @@ static void workspace_next(struct swaybar *bar, struct swaybar_output *output,
|
|||
}
|
||||
}
|
||||
|
||||
bool handle_workspace_button(struct swaybar_output *output,
|
||||
uint32_t button, bool released, const char *ws) {
|
||||
if (button == BTN_LEFT) {
|
||||
if (released) {
|
||||
// Since we handle the pressed event, also handle the released event
|
||||
// to block it from falling through to a binding in the bar
|
||||
return true;
|
||||
}
|
||||
ipc_send_workspace_command(output->bar, ws);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void process_discrete_scroll(struct swaybar_seat *seat,
|
||||
struct swaybar_output *output, struct swaybar_pointer *pointer,
|
||||
uint32_t axis, wl_fixed_t value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue