Skip to content

Commit c1bec21

Browse files
committed
perf: 仅第一次操作完才黏住
1 parent 942fb10 commit c1bec21

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

source/MaaWin32ControlUnit/Input/MessageInput.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ MessageInput::MessageInput(HWND hwnd, Config config)
1818
, config_(config)
1919
{
2020
if (config_.with_window_pos) {
21-
save_window_pos();
22-
auto [target_x, target_y] = get_target_pos();
23-
tracking_x_ = target_x;
24-
tracking_y_ = target_y;
25-
s_active_instance_ = this;
26-
tracking_active_ = true;
2721
tracking_thread_ = std::thread(&MessageInput::tracking_thread_func, this);
2822
}
2923
}
@@ -194,6 +188,9 @@ LPARAM MessageInput::prepare_mouse_position(int x, int y)
194188
std::this_thread::sleep_for(std::chrono::milliseconds(1));
195189
}
196190
else if (config_.with_window_pos) {
191+
if (!tracking_active_) {
192+
save_window_pos();
193+
}
197194
tracking_x_ = x;
198195
tracking_y_ = y;
199196
s_active_instance_ = this;

0 commit comments

Comments
 (0)