Skip to content

Commit

Permalink
Enabling 3DConnexion polling thread in windows, when working in remot…
Browse files Browse the repository at this point in the history
…e session, Adding ability to force hw rendering in remote session
  • Loading branch information
denis-itskovich authored and supermerill committed Jan 6, 2023
1 parent b324f4d commit e0f17bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/PrusaSlicer_app_msvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,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]);
}
Expand All @@ -253,7 +254,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 */
Expand Down
5 changes: 5 additions & 0 deletions src/slic3r/GUI/Mouse3DController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,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
}
}
Expand Down

0 comments on commit e0f17bd

Please sign in to comment.