diff options
author | Matt Ebb <matt@mke3.net> | 2010-04-01 05:27:22 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-04-01 05:27:22 +0400 |
commit | 8f5438dcd4faf07583c359b456a9b2db85a0c4d9 (patch) | |
tree | 8a8f0ab1df73ffec6e402068b6b009e6eddc341f /source/blender/editors/interface | |
parent | ea0e0b3f15852a062a0b6578f729d768e848f7d1 (diff) |
Fix [#21775] Double-clicking icons in the file browser doesn't open files
Complicated issue, but this should be correct, and testing goes fine. fingers crossed.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 2f14d23b518..54296b7cd6a 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2073,10 +2073,13 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE /* first handle click on icondrag type button */ if(event->type==LEFTMOUSE && but->dragpoin) { if(ui_but_mouse_inside_icon(but, data->region, event)) { + + /* tell the button to wait and keep checking further events to + * see if it should start dragging */ button_activate_state(C, but, BUTTON_STATE_WAIT_DRAG); data->dragstartx= event->x; data->dragstarty= event->y; - return WM_UI_HANDLER_BREAK; + return WM_UI_HANDLER_CONTINUE; } } @@ -2092,14 +2095,16 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, wmE return WM_UI_HANDLER_BREAK; } - /* pass on release as press for other keymaps XXX hack alert! */ + /* If the mouse has been pressed and released, getting to + * this point without triggering a drag, then clear the + * drag state for this button and continue to pass on the event */ if(event->type==LEFTMOUSE && event->val==KM_RELEASE) { button_activate_state(C, but, BUTTON_STATE_EXIT); - event->val= KM_CLICK; return WM_UI_HANDLER_CONTINUE; } - /* while wait drag, always block other events to get handled */ + /* while waiting for a drag to be triggered, always block + * other events from getting handled */ return WM_UI_HANDLER_BREAK; } |