[Bf-blender-cvs] [e0a30aef199] blender2.8: WM: Fix secondary toolbar events being ignored
Campbell Barton
noreply at git.blender.org
Thu Nov 15 23:20:49 CET 2018
Commit: e0a30aef1998602ea8f865b82b9bbad238392351
Author: Campbell Barton
Date: Fri Nov 16 09:19:33 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBe0a30aef1998602ea8f865b82b9bbad238392351
WM: Fix secondary toolbar events being ignored
Error in recent workaround.
===================================================================
M release/scripts/startup/bl_operators/wm.py
===================================================================
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index a45013583d6..c770746666d 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2393,9 +2393,9 @@ class WM_OT_tool_set_by_name(Operator):
if not self.properties.is_property_set("name"):
WM_OT_toolbar._key_held = False
return {'PASS_THROUGH'}
- elif WM_OT_toolbar._key_held and event.value != 'RELEASE':
+ elif (WM_OT_toolbar._key_held == event.type) and (event.value != 'RELEASE'):
return {'PASS_THROUGH'}
- WM_OT_toolbar._key_held = False
+ WM_OT_toolbar._key_held = None
return self.execute(context)
@@ -2422,13 +2422,16 @@ class WM_OT_toolbar(Operator):
bl_idname = "wm.toolbar"
bl_label = "Toolbar"
- if use_toolbar_release_hack:
- _key_held = False
-
@classmethod
def poll(cls, context):
return context.space_data is not None
+ if use_toolbar_release_hack:
+ _key_held = None
+ def invoke(self, context, event):
+ WM_OT_toolbar._key_held = event.type
+ return self.execute(context)
+
def execute(self, context):
from bl_ui.space_toolsystem_common import (
ToolSelectPanelHelper,
@@ -2444,10 +2447,6 @@ class WM_OT_toolbar(Operator):
keymap = keymap_from_context(context, space_type)
def draw_menu(popover, context):
- if use_toolbar_release_hack:
- # Release event sets false.
- WM_OT_toolbar._key_held = True
-
layout = popover.layout
layout.operator_context = 'INVOKE_REGION_WIN'
cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
More information about the Bf-blender-cvs
mailing list