Avoid modesetting if the display didn't change
This commit is contained in:
parent
f10b547a49
commit
6fdaa6ee8a
1 changed files with 5 additions and 2 deletions
|
|
@ -1662,8 +1662,11 @@ void Session::execInternal()
|
|||
flushWindowEvents();
|
||||
|
||||
// Update the window display mode based on our current monitor
|
||||
currentDisplayIndex = SDL_GetWindowDisplayIndex(m_Window);
|
||||
updateOptimalWindowDisplayMode();
|
||||
// NB: Avoid a useless modeset by only doing this if it changed.
|
||||
if (currentDisplayIndex != SDL_GetWindowDisplayIndex(m_Window)) {
|
||||
currentDisplayIndex = SDL_GetWindowDisplayIndex(m_Window);
|
||||
updateOptimalWindowDisplayMode();
|
||||
}
|
||||
|
||||
// Now that the old decoder is dead, flush any events it may
|
||||
// have queued to reset itself (if this reset was the result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue