Fixed ghost full-screen problem

After switching back from full-screen, the active window is returned to the one active before full-screen mode was entered.
Maarten
This commit is contained in:
Maarten Gribnau
2003-01-01 20:23:42 +00:00
parent 570b0462e2
commit 065f294aa1
2 changed files with 11 additions and 2 deletions

View File

@@ -47,8 +47,10 @@
#include "GHOST_Window.h" #include "GHOST_Window.h"
GHOST_WindowManager::GHOST_WindowManager() GHOST_WindowManager::GHOST_WindowManager() :
: m_fullScreenWindow(0), m_activeWindow(0) m_fullScreenWindow(0),
m_activeWindow(0),
m_activeWindowBeforeFullScreen(0)
{ {
} }
@@ -130,6 +132,7 @@ GHOST_TSuccess GHOST_WindowManager::beginFullScreen(GHOST_IWindow* window,
GHOST_ASSERT(window->getValid(), "GHOST_WindowManager::beginFullScreen(): invalid window"); GHOST_ASSERT(window->getValid(), "GHOST_WindowManager::beginFullScreen(): invalid window");
if (!getFullScreen()) { if (!getFullScreen()) {
m_fullScreenWindow = window; m_fullScreenWindow = window;
m_activeWindowBeforeFullScreen = getActiveWindow();
setActiveWindow(m_fullScreenWindow); setActiveWindow(m_fullScreenWindow);
success = GHOST_kSuccess; success = GHOST_kSuccess;
} }
@@ -147,6 +150,9 @@ GHOST_TSuccess GHOST_WindowManager::endFullScreen(void)
delete m_fullScreenWindow; delete m_fullScreenWindow;
//GHOST_PRINT("GHOST_WindowManager::endFullScreen(): done\n"); //GHOST_PRINT("GHOST_WindowManager::endFullScreen(): done\n");
m_fullScreenWindow = 0; m_fullScreenWindow = 0;
if (m_activeWindowBeforeFullScreen) {
setActiveWindow(m_activeWindowBeforeFullScreen);
}
} }
success = GHOST_kSuccess; success = GHOST_kSuccess;
} }

View File

@@ -155,6 +155,9 @@ protected:
/** The active window. */ /** The active window. */
GHOST_IWindow* m_activeWindow; GHOST_IWindow* m_activeWindow;
/** Window that was active before entering fullscreen state. */
GHOST_IWindow* m_activeWindowBeforeFullScreen;
}; };
#endif // _GHOST_WINDOW_MANAGER_H_ #endif // _GHOST_WINDOW_MANAGER_H_