Ticket #3571: 3571-Fix-aborts-of-MSG_MOUSE_DOWN.patch

File 3571-Fix-aborts-of-MSG_MOUSE_DOWN.patch, 950 bytes (added by mooffie, 9 years ago)
  • lib/widget/mouse.c

    From b1bad4ae20dbae321d43e8ba5c16491e3679b802 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Wed, 9 Mar 2016 03:54:23 +0200
    Subject: [PATCH] Fix aborts of MSG_MOUSE_DOWN.
    
    ---
     lib/widget/mouse.c | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/lib/widget/mouse.c b/lib/widget/mouse.c
    index 43b753b..29b0878 100644
    a b mouse_process_event (Widget * w, mouse_event_t * event, gboolean click) 
    182182    if (event->msg != 0) 
    183183    { 
    184184        ret = w->mouse_callback (w, event->msg, event); 
     185 
     186        if (event->msg == MSG_MOUSE_DOWN && ret == MSG_NOT_HANDLED) 
     187        { 
     188            /* If a widget aborts a MSG_MOUSE_DOWN, we uncapture it so it 
     189             * doesn't steal events from other widgets. */ 
     190            w->mouse.capture = FALSE; 
     191        } 
     192 
    185193        if (click) 
    186194            ret = w->mouse_callback (w, MSG_MOUSE_CLICK, event); 
    187195    }