[fix] reset display popup hover state after monitor switching to restore mouse control, fixes #83

This commit is contained in:
dijunkun
2026-05-25 01:28:17 +08:00
parent 473737ac9b
commit 37aabeaf72
3 changed files with 87 additions and 2 deletions
+4 -2
View File
@@ -163,6 +163,7 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
ImVec2 btn_min = ImGui::GetItemRectMin();
ImVec2 btn_size_actual = ImGui::GetItemRectSize();
props->display_selectable_hovered_ = false;
if (ImGui::BeginPopup("display")) {
ImGui::SetWindowFontScale(0.5f);
for (int i = 0; i < props->display_info_list_.size(); i++) {
@@ -178,8 +179,9 @@ int Render::ControlBar(std::shared_ptr<SubStreamWindowProperties>& props) {
props->control_data_label_.c_str());
}
}
props->display_selectable_hovered_ = ImGui::IsWindowHovered();
}
props->display_selectable_hovered_ =
ImGui::IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows);
ImGui::EndPopup();
}
@@ -486,4 +488,4 @@ int Render::NetTrafficStats(std::shared_ptr<SubStreamWindowProperties>& props) {
return 0;
}
} // namespace crossdesk
} // namespace crossdesk