Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 28ee6b8c0727cebb0ee778bbbc4bd55e1b34c52b Mon Sep 17 00:00:00 2001
- From: Mooffie <[email protected]>
- Date: Fri, 5 Feb 2016 16:23:54 +0200
- Subject: [PATCH] fixup! WListbox: optimize mouse event processing.
- ---
- lib/widget/listbox.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
- diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c
- index 84da74e..710b0f7 100644
- --- a/lib/widget/listbox.c
- +++ b/lib/widget/listbox.c
- @@ -519,7 +519,8 @@ listbox_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
- break;
- case MSG_MOUSE_CLICK:
- - if ((event->count & GPM_DOUBLE) != 0) /* Double click */
- + /* We don't call listbox_select_entry() here: MSG_MOUSE_DOWN/DRAG did this already. */
- + if (event->count == GPM_DOUBLE) /* Double click */
- listbox_do_action (l);
- break;
- @@ -527,8 +528,9 @@ listbox_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
- break;
- }
- - if (msg != MSG_MOUSE_UP && w->owner->state == DLG_ACTIVE)
- - listbox_draw (l, TRUE);
- + /* The selection may have changed. We redraw, and notify the dialog. */
- + if (msg != MSG_MOUSE_UP && msg != MSG_MOUSE_CLICK)
- + listbox_on_change (l);
- }
- /* --------------------------------------------------------------------------------------------- */
- --
- 2.5.0
Advertisement
Add Comment
Please, Sign In to add comment