From 065f294aa134cfedce9d0e984c357db2d18c7080 Mon Sep 17 00:00:00 2001 From: Maarten Gribnau Date: Wed, 1 Jan 2003 20:23:42 +0000 Subject: [PATCH] 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 --- intern/ghost/intern/GHOST_WindowManager.cpp | 10 ++++++++-- intern/ghost/intern/GHOST_WindowManager.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowManager.cpp b/intern/ghost/intern/GHOST_WindowManager.cpp index abce72e259c..775260a9503 100644 --- a/intern/ghost/intern/GHOST_WindowManager.cpp +++ b/intern/ghost/intern/GHOST_WindowManager.cpp @@ -47,8 +47,10 @@ #include "GHOST_Window.h" -GHOST_WindowManager::GHOST_WindowManager() -: m_fullScreenWindow(0), m_activeWindow(0) +GHOST_WindowManager::GHOST_WindowManager() : + 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"); if (!getFullScreen()) { m_fullScreenWindow = window; + m_activeWindowBeforeFullScreen = getActiveWindow(); setActiveWindow(m_fullScreenWindow); success = GHOST_kSuccess; } @@ -147,6 +150,9 @@ GHOST_TSuccess GHOST_WindowManager::endFullScreen(void) delete m_fullScreenWindow; //GHOST_PRINT("GHOST_WindowManager::endFullScreen(): done\n"); m_fullScreenWindow = 0; + if (m_activeWindowBeforeFullScreen) { + setActiveWindow(m_activeWindowBeforeFullScreen); + } } success = GHOST_kSuccess; } diff --git a/intern/ghost/intern/GHOST_WindowManager.h b/intern/ghost/intern/GHOST_WindowManager.h index a88b3f792ea..f2ad003d801 100644 --- a/intern/ghost/intern/GHOST_WindowManager.h +++ b/intern/ghost/intern/GHOST_WindowManager.h @@ -155,6 +155,9 @@ protected: /** The active window. */ GHOST_IWindow* m_activeWindow; + + /** Window that was active before entering fullscreen state. */ + GHOST_IWindow* m_activeWindowBeforeFullScreen; }; #endif // _GHOST_WINDOW_MANAGER_H_