Enabling 3DConnexion polling thread in windows, when working in remote session, Adding ability to force hw rendering in remote session

This commit is contained in:
denis-itskovich 2022-11-22 11:40:11 +02:00 committed by enricoturri1966
parent 4a22339621
commit cafdbb47ef
2 changed files with 8 additions and 2 deletions

View File

@ -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 */

View File

@ -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
}
}