File tree Expand file tree Collapse file tree
Sources/OvWindowing/src/OvWindowing Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515#include < stdexcept>
1616
17+ #if defined(_WIN32)
18+ #include < windows.h>
19+ #endif
20+
1721std::unordered_map<GLFWwindow*, OvWindowing::Window*> OvWindowing::Window::__WINDOWS_MAP;
1822
1923OvWindowing::Window::Window (const Context::Device& p_device, const Settings::WindowSettings& p_windowSettings) :
@@ -229,6 +233,18 @@ void OvWindowing::Window::SwapBuffers()
229233void OvWindowing::Window::SetCursorMode (Cursor::ECursorMode p_cursorMode)
230234{
231235 m_cursorMode = p_cursorMode;
236+
237+ // Workaround to avoid mouse issues with RDP sessions on Windows. (https://github.com/glfw/glfw/issues/2463)
238+ // This effectively disable the DISABLED cursor mode when in a remote session.
239+ // This is far from ideal, but at least it prevents the mouse from going crazy,
240+ // which keeps the application usable.
241+ #if defined(_WIN32)
242+ if (p_cursorMode == Cursor::ECursorMode::DISABLED && GetSystemMetrics (SM_REMOTESESSION))
243+ {
244+ return ;
245+ }
246+ #endif
247+
232248 glfwSetInputMode (m_glfwWindow, GLFW_CURSOR, static_cast <int >(p_cursorMode));
233249}
234250
You can’t perform that action at this time.
0 commit comments