Display/Display: Cache position when entering fullscreen and restore when entering window mode again.
This commit is contained in:
parent
d34d20361d
commit
d12d60b1ba
2 changed files with 13 additions and 0 deletions
|
|
@ -106,6 +106,11 @@ void Display::setVideoMode(Mode mode)
|
|||
m_impl->exitFullscreen();
|
||||
}
|
||||
|
||||
// Cache window position when entering fullscreen.
|
||||
if (mode == FULLSCREEN || mode == WINDOWEDFULLSCREEN) {
|
||||
m_cachePos = m_impl->getPosition();
|
||||
}
|
||||
|
||||
// True fullscreen
|
||||
if (mode == FULLSCREEN) {
|
||||
m_impl->enterFullscreen(m_description.mode);
|
||||
|
|
@ -120,6 +125,9 @@ void Display::setVideoMode(Mode mode)
|
|||
else {
|
||||
// Set stored decoration.
|
||||
m_impl->setDecoration(m_description.decoration);
|
||||
|
||||
// Restore position.
|
||||
m_impl->setPosition(m_cachePos.x, m_cachePos.y);
|
||||
}
|
||||
|
||||
m_fmode = mode;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue