Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.36 KB | None | 0 0
  1. From 28ee6b8c0727cebb0ee778bbbc4bd55e1b34c52b Mon Sep 17 00:00:00 2001
  2. From: Mooffie <mooffie@gmail.com>
  3. Date: Fri, 5 Feb 2016 16:23:54 +0200
  4. Subject: [PATCH] fixup! WListbox: optimize mouse event processing.
  5.  
  6. ---
  7. lib/widget/listbox.c | 8 +++++---
  8.  1 file changed, 5 insertions(+), 3 deletions(-)
  9.  
  10. diff --git a/lib/widget/listbox.c b/lib/widget/listbox.c
  11. index 84da74e..710b0f7 100644
  12. --- a/lib/widget/listbox.c
  13. +++ b/lib/widget/listbox.c
  14. @@ -519,7 +519,8 @@ listbox_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
  15.          break;
  16.  
  17.      case MSG_MOUSE_CLICK:
  18. -        if ((event->count & GPM_DOUBLE) != 0)   /* Double click */
  19. +        /* We don't call listbox_select_entry() here: MSG_MOUSE_DOWN/DRAG did this already. */
  20. +        if (event->count == GPM_DOUBLE) /* Double click */
  21.              listbox_do_action (l);
  22.          break;
  23.  
  24. @@ -527,8 +528,9 @@ listbox_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
  25.          break;
  26.      }
  27.  
  28. -    if (msg != MSG_MOUSE_UP && w->owner->state == DLG_ACTIVE)
  29. -        listbox_draw (l, TRUE);
  30. +    /* The selection may have changed. We redraw, and notify the dialog. */
  31. +    if (msg != MSG_MOUSE_UP && msg != MSG_MOUSE_CLICK)
  32. +        listbox_on_change (l);
  33.  }
  34.  
  35.  /* --------------------------------------------------------------------------------------------- */
  36. --
  37. 2.5.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement