From cafdbb47efa2eeefa14ca2b6045173e392f94a80 Mon Sep 17 00:00:00 2001 From: denis-itskovich Date: Tue, 22 Nov 2022 11:40:11 +0200 Subject: [PATCH] Enabling 3DConnexion polling thread in windows, when working in remote session, Adding ability to force hw rendering in remote session --- src/PrusaSlicer_app_msvc.cpp | 5 +++-- src/slic3r/GUI/Mouse3DController.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PrusaSlicer_app_msvc.cpp b/src/PrusaSlicer_app_msvc.cpp index 83f24c307..90bd2d89f 100644 --- a/src/PrusaSlicer_app_msvc.cpp +++ b/src/PrusaSlicer_app_msvc.cpp @@ -242,13 +242,14 @@ int wmain(int argc, wchar_t **argv) #ifdef SLIC3R_GUI // Here one may push some additional parameters based on the wrapper type. bool force_mesa = false; + bool force_hw = false; #endif /* SLIC3R_GUI */ for (int i = 1; i < argc; ++ i) { #ifdef SLIC3R_GUI if (wcscmp(argv[i], L"--sw-renderer") == 0) force_mesa = true; else if (wcscmp(argv[i], L"--no-sw-renderer") == 0) - force_mesa = false; + force_hw = true; #endif /* SLIC3R_GUI */ argv_extended.emplace_back(argv[i]); } @@ -261,7 +262,7 @@ int wmain(int argc, wchar_t **argv) force_mesa || // Running over a rempote desktop, and the RemoteFX is not enabled, therefore Windows will only provide SW OpenGL 1.1 context. // In that case, use Mesa. - ::GetSystemMetrics(SM_REMOTESESSION) || + (::GetSystemMetrics(SM_REMOTESESSION) && !force_hw) || // Try to load the default OpenGL driver and test its context version. ! opengl_version_check.load_opengl_dll() || ! opengl_version_check.is_version_greater_or_equal_to(2, 0); #endif /* SLIC3R_GUI */ diff --git a/src/slic3r/GUI/Mouse3DController.cpp b/src/slic3r/GUI/Mouse3DController.cpp index e5ad5d64f..1ce671753 100644 --- a/src/slic3r/GUI/Mouse3DController.cpp +++ b/src/slic3r/GUI/Mouse3DController.cpp @@ -668,6 +668,11 @@ void Mouse3DController::init() #ifndef _WIN32 // Don't start the background thread on Windows, as the HID messages are sent as Windows messages. m_thread = std::thread(&Mouse3DController::run, this); +#else + // For some reason, HID message routing does not work well with remote session. Requires further investigation + if (::GetSystemMetrics(SM_REMOTESESSION)) { + m_thread = std::thread(&Mouse3DController::run, this); + } #endif // _WIN32 } }