diff --git a/src/port/EterPythonLib/PythonWindowManager.cpp b/src/port/EterPythonLib/PythonWindowManager.cpp index 7863c17f..f8056c11 100644 --- a/src/port/EterPythonLib/PythonWindowManager.cpp +++ b/src/port/EterPythonLib/PythonWindowManager.cpp @@ -808,13 +808,6 @@ namespace UI SetMousePosition(x, y); CWindow * pPointWindow = __PickWindow(m_lMouseX, m_lMouseY); - if (x == 470 && y == 380) { - std::printf(">>> C++ RunMouseMove(470, 380): m_lMouse=(%ld, %ld), pPointWindow=%s (type=%s, is_show=%d)\n", - m_lMouseX, m_lMouseY, - pPointWindow ? pPointWindow->GetName() : "NULL", - pPointWindow ? typeid(*pPointWindow).name() : "none", - pPointWindow ? pPointWindow->IsShow() : 0); - } if (g_bShowOverInWindowName) { diff --git a/tests/port/port_login_flow_test.cpp b/tests/port/port_login_flow_test.cpp index 1d9177db..a0a090fb 100644 --- a/tests/port/port_login_flow_test.cpp +++ b/tests/port/port_login_flow_test.cpp @@ -164,6 +164,13 @@ static bool pump_until(double seconds, const std::function& done) // Runs a fixed number of frames: the wait between a mouse move and its click must not depend on how // many frames a loaded machine fits into a wall-clock slice (ctest -j). +// CPythonNetworkStream::GamePhase (40250) refreshes the inventory/safebox windows at most every 300 ms, +// so a slot can still be empty in the UI after player/safebox state already holds the item. +static void pump_ui_refresh() +{ + pump_until(0.35, [] { return false; }); +} + static void pump_frames(int count) { for (int i = 0; i < count && PythonBoot::IsAppLooping(); ++i) @@ -881,6 +888,7 @@ int main(int argc, char** argv) return py_true(("__import__('player').GetItemIndex(0) == " + std::to_string(FakeLoginServer::kShopItemVnum) + " and __import__('player').GetElk() == " + bought_gold).c_str()); })); + pump_ui_refresh(); click(1, bag0); CHECK(py_true("__import__('mouseModule').mouseController.isAttached()")); click(1, std::make_pair(shelf0.first + 32, shelf0.second)); @@ -1067,6 +1075,7 @@ int main(int argc, char** argv) std::printf("port_login_flow_test: safebox slot 0 at %d %d, bag slot 0 at %d %d\n", safe0.first, safe0.second, bag0.first, bag0.second); // Checkout: drag from safebox slot 0 to inventory slot 0 + pump_ui_refresh(); click(1, safe0); CHECK(py_true("__import__('mouseModule').mouseController.isAttached()")); click(1, bag0); @@ -1077,6 +1086,7 @@ int main(int argc, char** argv) })); // Checkin: drag from inventory slot 0 back to safebox slot 0 + pump_ui_refresh(); click(1, bag0); CHECK(py_true("__import__('mouseModule').mouseController.isAttached()")); click(1, safe0);