[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43723] trunk/blender/source/blender/ editors/interface/interface_handlers.c: Fix #29895 Fast Alt-Mousewheel toggling of Mapping Modes scrubs timeline

Sergey Sharybin sergey.vfx at gmail.com
Thu Jan 26 13:44:34 CET 2012


Revision: 43723
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43723
Author:   nazgul
Date:     2012-01-26 12:44:31 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-01-26 12:39:48 UTC (rev 43722)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-01-26 12:44:31 UTC (rev 43723)
@@ -3030,12 +3030,28 @@
 				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;
 			}
 		}



More information about the Bf-blender-cvs mailing list