[fix] fix Wayland reconnect black screen by keeping capturer warm and also fix Wayland mouse control

This commit is contained in:
dijunkun
2026-03-23 05:18:56 +08:00
parent 518e1afa58
commit 511831ced3
17 changed files with 2418 additions and 203 deletions
+25 -1
View File
@@ -1,5 +1,8 @@
#include "platform.h"
#include <cstdlib>
#include <cstring>
#include "rd_log.h"
#ifdef _WIN32
@@ -125,4 +128,25 @@ std::string GetHostName() {
#endif
return hostname;
}
} // namespace crossdesk
bool IsWaylandSession() {
#if defined(__linux__) && !defined(__APPLE__)
const char* session_type = std::getenv("XDG_SESSION_TYPE");
if (session_type) {
if (std::strcmp(session_type, "wayland") == 0 ||
std::strcmp(session_type, "Wayland") == 0) {
return true;
}
if (std::strcmp(session_type, "x11") == 0 ||
std::strcmp(session_type, "X11") == 0) {
return false;
}
}
const char* wayland_display = std::getenv("WAYLAND_DISPLAY");
return wayland_display && wayland_display[0] != '\0';
#else
return false;
#endif
}
} // namespace crossdesk