mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-11 10:16:09 +00:00
Change mute on minimize to mute on focus loss
Minimization doesn't always happen on focus loss in full-screen mode, so it could lead to unpredictable behavior.
This commit is contained in:
@@ -1345,22 +1345,19 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
||||
// Early handling of some events
|
||||
switch (event.window.event) {
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
if (m_Preferences->muteOnFocusLoss) {
|
||||
m_AudioMuted = true;
|
||||
}
|
||||
m_InputHandler->notifyFocusLost();
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
if (m_Preferences->muteOnFocusLoss) {
|
||||
m_AudioMuted = false;
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT_LEAVE:
|
||||
m_InputHandler->notifyMouseLeave();
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MINIMIZED:
|
||||
if (m_Preferences->muteOnMinimize) {
|
||||
m_AudioMuted = true;
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
||||
case SDL_WINDOWEVENT_RESTORED:
|
||||
if (m_Preferences->muteOnMinimize) {
|
||||
m_AudioMuted = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Capture the mouse on SDL_WINDOWEVENT_ENTER if needed
|
||||
|
||||
Reference in New Issue
Block a user