mirror of
https://github.com/swaywm/sway.git
synced 2026-03-21 05:33:56 -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
|
|
@ -599,16 +599,8 @@ static uint32_t render_binding_mode_indicator(struct render_context *ctx,
|
|||
static enum hotspot_event_handling workspace_hotspot_callback(
|
||||
struct swaybar_output *output, struct swaybar_hotspot *hotspot,
|
||||
double x, double y, uint32_t button, bool released, void *data) {
|
||||
if (button != BTN_LEFT) {
|
||||
return HOTSPOT_PROCESS;
|
||||
}
|
||||
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 HOTSPOT_IGNORE;
|
||||
}
|
||||
ipc_send_workspace_command(output->bar, (const char *)data);
|
||||
return HOTSPOT_IGNORE;
|
||||
return handle_workspace_button(output, button, released, (const char *)data)
|
||||
? HOTSPOT_IGNORE : HOTSPOT_PROCESS;
|
||||
}
|
||||
|
||||
static uint32_t render_workspace_button(struct render_context *ctx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue