Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-26 16:44:31 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-26 16:44:31 +0400
commit83a6b331a75580f9eab24f4fe0b3fd6a1db9fab9 (patch)
tree5db64f90780dd8d5a9e23ff8639be491d9c6e3b3 /source/blender/editors/interface/interface_handlers.c
parentdb57cbac20bb513ba688c5cfb2655d8753a89aab (diff)
Fix #29895 Fast Alt-Mousewheel toggling of Mapping Modes scrubs timeline
Issue was caused by changing button state to EXIT, so there's no active button just after applying Alt-Wheel event. Setting this state is needed to prevent button trigger cancel callback when mouse is leaving hovered menu button. Using the same "post activate" trick used by Tab button allows to make prevent canceling button and makes this button active again after applying all handlers. There's still issues with Alt-Scroll if changing active element in menu leads to interface changes (like file format in render buttons) -- in this case button simple doesn't receive wheel events and it's actually not connected to this issue.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 93d8f9c0c8a..849d3ecc758 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -3030,12 +3030,28 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, wm
data->value= ui_step_name_menu(but, -1);
button_activate_state(C, but, BUTTON_STATE_EXIT);
ui_apply_button(C, but->block, but, data, 1);
+
+ /* button's state need to be changed to EXIT so moving mouse away from this mouse wouldn't lead
+ * to cancel changes made to this button, but shanging state to EXIT also makes no button active for
+ * a while which leads to triggering operator when doing fast scrolling mouse wheel.
+ * using post activate stuff from button allows to make button be active again after checking for all
+ * all that mouse leave and cancel stuff, so wuick scrool wouldnt't be an issue anumore.
+ * same goes for scrolling wheel in another direction below (sergey)
+ */
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_OVER;
+
return WM_UI_HANDLER_BREAK;
}
else if(event->type == WHEELUPMOUSE && event->alt) {
data->value= ui_step_name_menu(but, 1);
button_activate_state(C, but, BUTTON_STATE_EXIT);
ui_apply_button(C, but->block, but, data, 1);
+
+ /* why this is needed described above */
+ data->postbut= but;
+ data->posttype= BUTTON_ACTIVATE_OVER;
+
return WM_UI_HANDLER_BREAK;
}
}