Commit: 537db96fb7e35c3dbc731df3546a842f7ec606a4 Author: Campbell Barton Date: Sun Jan 22 21:06:10 2023 +1100 Branches: master https://developer.blender.org/rB537db96fb7e35c3dbc731df3546a842f7ec606a4
GHOST/NDOF: don't send button events when there is no active window NDOF events without an active window were ignored and printed warnings in the console. =================================================================== M intern/ghost/intern/GHOST_NDOFManager.cpp =================================================================== diff --git a/intern/ghost/intern/GHOST_NDOFManager.cpp b/intern/ghost/intern/GHOST_NDOFManager.cpp index 5484da82a18..ffd9c57803c 100644 --- a/intern/ghost/intern/GHOST_NDOFManager.cpp +++ b/intern/ghost/intern/GHOST_NDOFManager.cpp @@ -464,12 +464,17 @@ void GHOST_NDOFManager::updateButton(int button_number, bool press, uint64_t tim ndof_button_names[button]); GHOST_IWindow *window = system_.getWindowManager()->getActiveWindow(); - const GHOST_TKey key = ghost_map_keyboard_from_ndof_buttom(button); - if (key != GHOST_kKeyUnknown) { - sendKeyEvent(key, press, time, window); - } - else { - sendButtonEvent(button, press, time, window); + + /* Delivery will fail, so don't bother sending. + * Do, however update the buttons internal depressed state. */ + if (window != nullptr) { + const GHOST_TKey key = ghost_map_keyboard_from_ndof_buttom(button); + if (key != GHOST_kKeyUnknown) { + sendKeyEvent(key, press, time, window); + } + else { + sendButtonEvent(button, press, time, window); + } } int mask = 1 << button_number; @@ -547,9 +552,11 @@ bool GHOST_NDOFManager::sendMotionEvent() GHOST_IWindow *window = system_.getWindowManager()->getActiveWindow(); + /* Delivery will fail, so don't bother sending. */ if (window == nullptr) { - motion_state_ = GHOST_kNotStarted; /* Avoid large `dt` times when changing windows. */ - return false; /* Delivery will fail, so don't bother sending. */ + /* Avoid large `dt` times when changing windows. */ + motion_state_ = GHOST_kNotStarted; + return false; } GHOST_EventNDOFMotion *event = new GHOST_EventNDOFMotion(motion_time_, window); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs