[Bf-blender-cvs] [b2dc1f93475] temp-T97352-3d-texturing-seam-bleeding-b2: WM: send a modifier press when activating a window with modifier held

Campbell Barton noreply at git.blender.org
Tue Sep 20 10:32:12 CEST 2022


Commit: b2dc1f93475f690697ec1faa5af87a6930eaa9b0
Author: Campbell Barton
Date:   Sat Sep 17 23:54:23 2022 +1000
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBb2dc1f93475f690697ec1faa5af87a6930eaa9b0

WM: send a modifier press when activating a window with modifier held

Previously the a simulated event was sent for releasing modifiers
on activation but pressing only set the eventstate flag.

Prefer the simulated events since press/release events are used in some
modal key-maps.

===================================================================

M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 208b3dbc89d..9180c53aeb5 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1167,7 +1167,12 @@ static bool ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_pt
 #ifdef USE_WIN_ACTIVATE
             else {
               if (keymodifier & g_modifier_table[i].flag) {
-                win->eventstate->modifier |= g_modifier_table[i].flag;
+                for (int side = 0; side < 2; side++) {
+                  if (keymodifier_sided[side] & g_modifier_table[i].flag) {
+                    kdata.key = g_modifier_table[i].ghost_key_pair[side];
+                    wm_event_add_ghostevent(wm, win, GHOST_kEventKeyDown, &kdata);
+                  }
+                }
               }
             }
 #endif



More information about the Bf-blender-cvs mailing list