Fix toolbar popup outside the window region
authorCampbell Barton <ideasman42@gmail.com>
Mon, 3 Sep 2018 00:19:30 +0000 (10:19 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 3 Sep 2018 00:19:30 +0000 (10:19 +1000)
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/space_toolsystem_common.py

index 0ccdd3cf5c6ca679806b20f122f73de2a25a1883..da4ba10a9bf166db6628a6c1a37eb5fcce92160a 100644 (file)
@@ -2407,7 +2407,7 @@ class WM_OT_toolbar(Operator):
         def draw_menu(popover, context):
             layout = popover.layout
 
-            layout.operator_context = 'INVOKE_DEFAULT'
+            layout.operator_context = 'INVOKE_REGION_WIN'
             layout.operator("wm.search_menu", text="Search Commands...", icon='VIEWZOOM')
 
             cls.draw_cls(layout, context, detect_layout=False, scale_y=1.0)
index 1be86ea7c1c0ea4559390279d3eb68023f243677..d338855a8e40f707d8a3b4a4c50d48f3375cecc9 100644 (file)
@@ -740,12 +740,14 @@ def keymap_from_context(context, space_type):
             if item.operator is not None:
                 kmi_found = wm.keyconfigs.find_item_from_operator(
                     idname=item.operator,
+                    context='INVOKE_REGION_WIN',
                 )[1]
             elif item.keymap is not None:
                 kmi_first = item.keymap[0].keymap_items[0]
                 kmi_found = wm.keyconfigs.find_item_from_operator(
                     idname=kmi_first.idname,
                     # properties=kmi_first.properties,  # prevents matches, don't use.
+                    context='INVOKE_REGION_WIN',
                 )[1]
                 del kmi_first
             else:
@@ -863,7 +865,10 @@ def keymap_from_context(context, space_type):
 
     if True:
         # The shortcut will show, so we better support running it.
-        kmi_search = wm.keyconfigs.find_item_from_operator(idname="wm.search_menu")[1]
+        kmi_search = wm.keyconfigs.find_item_from_operator(
+            idname="wm.search_menu",
+            context='INVOKE_REGION_WIN',
+        )[1]
         if kmi_search:
             keymap.keymap_items.new(
                 "wm.search_menu",