mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-10-26 05:50:49 +00:00
Abstract fullscreen details into SDLC functions
This commit is contained in:
1 parent
13b2b28c2f
commit
a37020b974
10 files changed
+65
-25
No files matched your search
@@ -289,7 +289,7 @@ void SdlInputHandler::notifyFocusLost()
|
||||
// This lets user to interact with our window's title bar and with the buttons in it.
|
||||
// Doing this while the window is full-screen breaks the transition out of FS
|
||||
// (desktop and exclusive), so we must check for that before releasing mouse capture.
|
||||
if (!(SDL_GetWindowFlags(m_Window) & SDL_WINDOW_FULLSCREEN) && !m_AbsoluteMouseMode) {
|
||||
if (!SDLC_IsFullscreen(m_Window) && !m_AbsoluteMouseMode) {
|
||||
setCaptureActive(false);
|
||||
}
|
||||
|
||||
@@ -315,9 +315,8 @@ void SdlInputHandler::updateKeyboardGrabState()
|
||||
}
|
||||
|
||||
bool shouldGrab = isCaptureActive();
|
||||
Uint32 windowFlags = SDL_GetWindowFlags(m_Window);
|
||||
if (m_CaptureSystemKeysMode == StreamingPreferences::CSK_FULLSCREEN &&
|
||||
!(windowFlags & SDL_WINDOW_FULLSCREEN)) {
|
||||
!SDLC_IsFullscreen(m_Window)) {
|
||||
// Ungrab if it's fullscreen only and we left fullscreen
|
||||
shouldGrab = false;
|
||||
}
|
||||
@@ -355,7 +354,7 @@ bool SdlInputHandler::isSystemKeyCaptureActive()
|
||||
}
|
||||
|
||||
if (m_CaptureSystemKeysMode == StreamingPreferences::CSK_FULLSCREEN &&
|
||||
!(windowFlags & SDL_WINDOW_FULLSCREEN)) {
|
||||
!SDLC_IsFullscreen(m_Window)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ void SdlInputHandler::updatePointerRegionLock()
|
||||
// have full control over it and we don't touch it anymore.
|
||||
if (!m_PointerRegionLockToggledByUser) {
|
||||
// Lock the pointer in true full-screen mode and leave it unlocked in other modes
|
||||
m_PointerRegionLockActive = (SDL_GetWindowFlags(m_Window) & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN;
|
||||
m_PointerRegionLockActive = SDLC_IsFullscreenExclusive(m_Window);
|
||||
}
|
||||
|
||||
// If region lock is enabled, grab the cursor so it can't accidentally leave our window.
|
||||
|
||||
Reference in new issue
Block a user