mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-05-18 23:50:16 +00:00
+17
-11
@@ -1888,17 +1888,23 @@ void Session::exec()
|
|||||||
bool needsFirstEnterCapture = false;
|
bool needsFirstEnterCapture = false;
|
||||||
bool needsPostDecoderCreationCapture = false;
|
bool needsPostDecoderCreationCapture = false;
|
||||||
|
|
||||||
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
// Avoid capturing the mouse initially for windowed relative mode.
|
||||||
// event where it seems to work consistently on GNOME. For other platforms,
|
// We still capture in windowed absolute mode because it doesn't
|
||||||
// especially where SDL may call SDL_RecreateWindow(), we must only capture
|
// constrain the motion of the cursor. This allows the user to
|
||||||
// after the decoder is created.
|
// easily reposition or resize the window.
|
||||||
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
if (m_IsFullScreen || m_Preferences->absoluteMouseMode) {
|
||||||
// Native Wayland: Capture on SDL_WINDOWEVENT_ENTER
|
// HACK: For Wayland, we wait until we get the first SDL_WINDOWEVENT_ENTER
|
||||||
needsFirstEnterCapture = true;
|
// event where it seems to work consistently on GNOME. For other platforms,
|
||||||
}
|
// especially where SDL may call SDL_RecreateWindow(), we must only capture
|
||||||
else {
|
// after the decoder is created.
|
||||||
// X11/XWayland: Capture after decoder creation
|
if (strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
|
||||||
needsPostDecoderCreationCapture = true;
|
// Native Wayland: Capture on SDL_WINDOWEVENT_ENTER
|
||||||
|
needsFirstEnterCapture = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// X11/XWayland: Capture after decoder creation
|
||||||
|
needsPostDecoderCreationCapture = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop text input. SDL enables it by default
|
// Stop text input. SDL enables it by default
|
||||||
|
|||||||
Reference in New Issue
Block a user