From 5ea5c5deb66f2e81e49ef44b9791f0d643748f6c Mon Sep 17 00:00:00 2001 From: Mooffie Date: Wed, 25 Jan 2017 18:36:16 +0200 Subject: [PATCH] Ticket #3760: Fix aborts of MSG_MOUSE_DOWN. This patch was supposed to get committed as part of #3571 but this never happened. We commit it now as we depend on its functionality for the next commit. Signed-off-by: Mooffie --- lib/widget/mouse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/widget/mouse.c b/lib/widget/mouse.c index 2ac099cbd..9c9fd6853 100644 --- a/lib/widget/mouse.c +++ b/lib/widget/mouse.c @@ -181,6 +181,11 @@ mouse_process_event (Widget * w, mouse_event_t * event) { w->mouse_callback (w, event->msg, event); + /* If a widget aborts a MSG_MOUSE_DOWN, we uncapture it so it + * doesn't steal events from other widgets. */ + if (event->msg == MSG_MOUSE_DOWN && event->result.abort) + w->mouse.capture = FALSE; + /* Upon releasing the mouse button: if the mouse hasn't been dragged * since the MSG_MOUSE_DOWN, we also trigger a click. */ if (event->msg == MSG_MOUSE_UP && w->mouse.last_msg == MSG_MOUSE_DOWN)