From 6fccd894ef9ca20c6abc344c1a26f02dc6ed4f4c Mon Sep 17 00:00:00 2001 From: ernestoCruz05 Date: Sun, 5 Apr 2026 11:41:07 +0100 Subject: [PATCH] fix: buttonpress return types and tablet motion arguments --- src/ext-protocol/tablet.h | 12 +++++++----- src/mango.c | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ext-protocol/tablet.h b/src/ext-protocol/tablet.h index 6aa7ae86..254f0264 100644 --- a/src/ext-protocol/tablet.h +++ b/src/ext-protocol/tablet.h @@ -50,7 +50,7 @@ static void attach_tablet_pad(struct TabletPad *tablet_pad, struct Tablet *tablet); static void tablettoolmotion(struct TabletTool *tool, bool change_x, bool change_y, double x, double y, double dx, - double dy); + double dy, uint32_t time_msec); static struct wl_listener tablet_tool_axis = {.notify = tablettoolaxis}; static struct wl_listener tablet_tool_button = {.notify = tablettoolbutton}; @@ -234,7 +234,8 @@ static void tablettoolsetcursor(struct wl_listener *listener, void *data) { } void tablettoolmotion(struct TabletTool *tool, bool change_x, bool change_y, - double x, double y, double dx, double dy) { + double x, double y, double dx, double dy, + uint32_t time_msec) { struct wlr_surface *surface = NULL; Client *c = NULL, *w = NULL; LayerSurface *l = NULL; @@ -257,7 +258,7 @@ void tablettoolmotion(struct TabletTool *tool, bool change_x, bool change_y, break; } - motionnotify(0, NULL, 0, 0, 0, 0); + motionnotify(time_msec, NULL, 0, 0, 0, 0); if (config.sloppyfocus) selmon = xytomon(cursor->x, cursor->y); @@ -355,7 +356,8 @@ void tablettoolproximity(struct wl_listener *listener, void *data) { tool->curr_surface = NULL; break; case WLR_TABLET_TOOL_PROXIMITY_IN: - tablettoolmotion(tool, true, true, event->x, event->y, 0, 0); + tablettoolmotion(tool, true, true, event->x, event->y, 0, 0, + event->time_msec); break; } } @@ -368,7 +370,7 @@ void tablettoolaxis(struct wl_listener *listener, void *data) { tablettoolmotion(tool, event->updated_axes & WLR_TABLET_TOOL_AXIS_X, event->updated_axes & WLR_TABLET_TOOL_AXIS_Y, event->x, - event->y, event->dx, event->dy); + event->y, event->dx, event->dy, event->time_msec); if (event->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE) wlr_tablet_v2_tablet_tool_notify_pressure(tool->tool_v2, diff --git a/src/mango.c b/src/mango.c index de682be6..93e8f2a3 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2256,7 +2256,7 @@ bool handle_buttonpress(struct wlr_pointer_button_event *event) { grabcy = (int32_t)round(cursor->y); cursor_mode = CurPan; wlr_cursor_set_xcursor(cursor, cursor_mgr, "grabbing"); - return; + return true; } } @@ -2345,7 +2345,7 @@ bool handle_buttonpress(struct wlr_pointer_button_event *event) { selmon->canvas_overview_anim_start = get_now_in_ms(); arrange(selmon, true, false); request_fresh_all_monitors(); - return; + return true; } if (selmon->isoverview && event->button == BTN_RIGHT && c) { @@ -2367,7 +2367,7 @@ bool handle_buttonpress(struct wlr_pointer_button_event *event) { cursor_mode = CurNormal; wlr_cursor_set_xcursor(cursor, cursor_mgr, "default"); motionnotify(0, NULL, 0, 0, 0, 0); - return; + return false; } /* If you released any buttons, we exit interactive move/resize mode. */ if (!locked && cursor_mode != CurNormal && cursor_mode != CurPressed) {