aboutsummaryrefslogtreecommitdiffstats
path: root/src/skel
diff options
context:
space:
mode:
authorGreg V <greg@unrelenting.technology>2020-09-28 04:53:15 +0300
committerGreg V <greg@unrelenting.technology>2020-09-28 04:53:15 +0300
commit0205960a2fe13174b5dc17abf080b6821a3c883a (patch)
treedd11ed43979354559086030437a76dcef089eb2d /src/skel
parentb95accb8ff6a594d1a920b94823b38be3515f149 (diff)
Use GLFW_CURSOR_DISABLED (glfw's native mouse restriction)
On Wayland, clients cannot move the mouse pointer. Mouse constraints, as required for 3D camera movement, are an explicit specific thing, and glfw supports it with GLFW_CURSOR_DISABLED. Use DISABLED, unless we're in a menu in windowed mode, where HIDDEN is still appropriate.
Diffstat (limited to 'src/skel')
-rw-r--r--src/skel/glfw/glfw.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index d7054b9c..e954e04b 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -1628,6 +1628,8 @@ main(int argc, char *argv[])
#endif
{
glfwPollEvents();
+ glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR,
+ (FrontEndMenuManager.m_bMenuActive && !PSGLOBAL(fullScreen)) ? GLFW_CURSOR_HIDDEN : GLFW_CURSOR_DISABLED);
if( ForegroundApp )
{
switch ( gGameState )