fix(windows): resolve disappearing cursor after KVM switch (#4407)

This commit is contained in:
tstokes22 2026-01-16 19:45:16 -05:00 committed by GitHub
commit fd2bfaac7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 0 deletions

View file

@ -610,6 +610,8 @@ namespace platf {
}; };
void adjust_thread_priority(thread_priority_e priority); void adjust_thread_priority(thread_priority_e priority);
void enable_mouse_keys();
// Allow OS-specific actions to be taken to prepare for streaming // Allow OS-specific actions to be taken to prepare for streaming
void streaming_will_start(); void streaming_will_start();
void streaming_will_stop(); void streaming_will_stop();

View file

@ -327,6 +327,10 @@ namespace platf {
// Unimplemented // Unimplemented
} }
void enable_mouse_keys() {
// Unimplemented
}
void streaming_will_start() { void streaming_will_start() {
// Nothing to do // Nothing to do
} }

View file

@ -214,6 +214,10 @@ namespace platf {
// Unimplemented // Unimplemented
} }
void enable_mouse_keys() {
// Unimplemented
}
void streaming_will_start() { void streaming_will_start() {
// Nothing to do // Nothing to do
} }

View file

@ -1133,7 +1133,10 @@ namespace platf {
} }
} }
} }
enable_mouse_keys();
}
void enable_mouse_keys() {
// If there is no mouse connected, enable Mouse Keys to force the cursor to appear // If there is no mouse connected, enable Mouse Keys to force the cursor to appear
if (!GetSystemMetrics(SM_MOUSEPRESENT)) { if (!GetSystemMetrics(SM_MOUSEPRESENT)) {
BOOST_LOG(info) << "A mouse was not detected. Sunshine will enable Mouse Keys while streaming to force the mouse cursor to appear."; BOOST_LOG(info) << "A mouse was not detected. Sunshine will enable Mouse Keys while streaming to force the mouse cursor to appear.";

View file

@ -1977,6 +1977,10 @@ namespace video {
} }
session->request_normal_frame(); session->request_normal_frame();
// While streaming check to see if the mouse is present and enable Mouse Keys to force the cursor to appear
// This is useful for KVM switch scenarios where mouse may disappear during streaming
platf::enable_mouse_keys();
} }
} }