[Bf-blender-cvs] [37b7b3a] master: T47532: Pop-ups drop fast mouse clicks
Julian Eisel
noreply at git.blender.org
Mon Mar 28 16:46:48 CEST 2016
Commit: 37b7b3a9355af05ad322491c20dab9fb3e79b54d
Author: Julian Eisel
Date: Mon Mar 28 16:42:13 2016 +0200
Branches: master
https://developer.blender.org/rB37b7b3a9355af05ad322491c20dab9fb3e79b54d
T47532: Pop-ups drop fast mouse clicks
Caused by rBc24be7ec6e5.
Before rBc24be7ec6e5, wm_handlers_do always called handlers a second time with event value KM_PRESS in case of a double click. After it, this was only the case for non-LEFTMOUSE events.
Since ui_popup_handler (almost) always returned WM_UI_HANDLER_BREAK, the second handler iteration with KM_PRESS wouldn't run. This fix just makes sure we return WM_UI_HANDLER_CONTINUE for double click events instead (causing second iteration to run).
===================================================================
M source/blender/editors/interface/interface_handlers.c
===================================================================
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 8363582..01fc6aa 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -9954,10 +9954,14 @@ static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata)
menu_region = CTX_wm_menu(C);
CTX_wm_menu_set(C, menu->region);
- if (event->type == EVT_DROP) {
- /* if we're handling drop event we'll want it to be handled by popup callee as well,
- * so it'll be possible to perform such operations as opening .blend files by dropping
- * them into blender even if there's opened popup like splash screen (sergey)
+ if (event->type == EVT_DROP || event->val == KM_DBL_CLICK) {
+ /* EVT_DROP:
+ * If we're handling drop event we'll want it to be handled by popup callee as well,
+ * so it'll be possible to perform such operations as opening .blend files by dropping
+ * them into blender, even if there's opened popup like splash screen (sergey).
+ * KM_DBL_CLICK:
+ * Continue in case of double click so wm_handlers_do calls handler again with KM_PRESS
+ * event. This is needed to ensure correct button handling for fast clicking (T47532).
*/
retval = WM_UI_HANDLER_CONTINUE;
More information about the Bf-blender-cvs
mailing list