From f459d97dfd6f68944e20d9c3741cc5715717b9fa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Apr 2025 05:18:57 +0000 Subject: [PATCH] Cleanup: remove unused full-screen support from GHOST Remove full-screen support from GHOST API's. Note that this only had back-end implements for X11 and WIN32. This was last used for the Game Engine to run games full-screen, removing as it's unused and it doesn't seem likely to be used in the future. This doesn't impact making Blender full-screen from the window menu which uses a window decoration setting. Ref: !137050 --- intern/ghost/GHOST_C-api.h | 26 ---- intern/ghost/GHOST_ISystem.hh | 33 ----- intern/ghost/GHOST_IWindow.hh | 4 - intern/ghost/intern/GHOST_C-api.cc | 34 ------ intern/ghost/intern/GHOST_System.cc | 133 +-------------------- intern/ghost/intern/GHOST_System.hh | 46 ------- intern/ghost/intern/GHOST_WindowCocoa.hh | 10 -- intern/ghost/intern/GHOST_WindowManager.cc | 78 ++---------- intern/ghost/intern/GHOST_WindowManager.hh | 31 ----- intern/ghost/intern/GHOST_WindowNULL.hh | 9 -- intern/ghost/intern/GHOST_WindowSDL.hh | 11 -- intern/ghost/intern/GHOST_WindowWayland.cc | 37 ------ intern/ghost/intern/GHOST_WindowWayland.hh | 4 - intern/ghost/intern/GHOST_WindowWin32.hh | 10 -- intern/ghost/intern/GHOST_WindowX11.cc | 52 -------- intern/ghost/intern/GHOST_WindowX11.hh | 4 - intern/ghost/test/gears/GHOST_C-Test.c | 40 +------ intern/ghost/test/gears/GHOST_Test.cpp | 33 +---- 18 files changed, 20 insertions(+), 575 deletions(-) diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index 0ad0784767f..4368ab0c71a 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -228,32 +228,6 @@ extern GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, */ extern bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle); -/** - * Begins full screen mode. - * \param systemhandle: The handle to the system. - * \param setting: The new setting of the display. - * \param stereoVisual: Option for stereo display. - * \return A handle to the window displayed in full screen. - * This window is invalid after full screen has been ended. - */ -extern GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle, - const GHOST_DisplaySetting *setting, - const bool stereoVisual); - -/** - * Ends full screen mode. - * \param systemhandle: The handle to the system. - * \return Indication of success. - */ -extern GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle); - -/** - * Returns current full screen mode status. - * \param systemhandle: The handle to the system. - * \return The current status. - */ -extern bool GHOST_GetFullScreen(GHOST_SystemHandle systemhandle); - /** * Get the Window under the cursor. Although coordinates of the mouse are supplied, platform- * specific implementations are free to ignore these and query the mouse location themselves, due diff --git a/intern/ghost/GHOST_ISystem.hh b/intern/ghost/GHOST_ISystem.hh index d473069956e..50379f8690e 100644 --- a/intern/ghost/GHOST_ISystem.hh +++ b/intern/ghost/GHOST_ISystem.hh @@ -278,39 +278,6 @@ class GHOST_ISystem { */ virtual bool validWindow(GHOST_IWindow *window) = 0; - /** - * Begins full screen mode. - * \param setting: The new setting of the display. - * \param window: Window displayed in full screen. - * This window is invalid after full screen has been ended. - * \return Indication of success. - */ - virtual GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow **window, - const bool stereoVisual) = 0; - - /** - * Updates the resolution while in full-screen mode. - * \param setting: The new setting of the display. - * \param window: Window displayed in full screen. - * - * \return Indication of success. - */ - virtual GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow **window) = 0; - - /** - * Ends full screen mode. - * \return Indication of success. - */ - virtual GHOST_TSuccess endFullScreen() = 0; - - /** - * Returns current full screen mode status. - * \return The current status. - */ - virtual bool getFullScreen() = 0; - /** * Native pixel size support (MacBook 'retina'). */ diff --git a/intern/ghost/GHOST_IWindow.hh b/intern/ghost/GHOST_IWindow.hh index 4c38a9b83bc..50c86ed7a0b 100644 --- a/intern/ghost/GHOST_IWindow.hh +++ b/intern/ghost/GHOST_IWindow.hh @@ -354,10 +354,6 @@ class GHOST_IWindow { return GHOST_kSuccess; } - /** */ - virtual GHOST_TSuccess beginFullScreen() const = 0; - virtual GHOST_TSuccess endFullScreen() const = 0; - virtual float getNativePixelSize() = 0; /** diff --git a/intern/ghost/intern/GHOST_C-api.cc b/intern/ghost/intern/GHOST_C-api.cc index f130aa22b5e..9e4f272adfe 100644 --- a/intern/ghost/intern/GHOST_C-api.cc +++ b/intern/ghost/intern/GHOST_C-api.cc @@ -217,40 +217,6 @@ bool GHOST_ValidWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windo return system->validWindow(window); } -GHOST_WindowHandle GHOST_BeginFullScreen(GHOST_SystemHandle systemhandle, - const GHOST_DisplaySetting *setting, - const bool stereoVisual) -{ - GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; - GHOST_IWindow *window = nullptr; - bool bstereoVisual; - - if (stereoVisual) { - bstereoVisual = true; - } - else { - bstereoVisual = false; - } - - system->beginFullScreen(*setting, &window, bstereoVisual); - - return (GHOST_WindowHandle)window; -} - -GHOST_TSuccess GHOST_EndFullScreen(GHOST_SystemHandle systemhandle) -{ - GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; - - return system->endFullScreen(); -} - -bool GHOST_GetFullScreen(GHOST_SystemHandle systemhandle) -{ - GHOST_ISystem *system = (GHOST_ISystem *)systemhandle; - - return system->getFullScreen(); -} - GHOST_WindowHandle GHOST_GetWindowUnderCursor(GHOST_SystemHandle systemhandle, int32_t x, int32_t y) diff --git a/intern/ghost/intern/GHOST_System.cc b/intern/ghost/intern/GHOST_System.cc index bed3a998419..e68aad1ffaa 100644 --- a/intern/ghost/intern/GHOST_System.cc +++ b/intern/ghost/intern/GHOST_System.cc @@ -29,7 +29,6 @@ GHOST_System::GHOST_System() #ifdef WITH_INPUT_NDOF m_ndofManager(nullptr), #endif - m_preFullScreenSetting{0}, m_multitouchGestures(true), m_tabletAPI(GHOST_kTabletAutomatic), m_is_debug_enabled(false) @@ -97,19 +96,14 @@ GHOST_TSuccess GHOST_System::disposeWindow(GHOST_IWindow *window) if (m_windowManager->getWindowFound(window)) { m_eventManager->removeWindowEvents(window); } - if (window == m_windowManager->getFullScreenWindow()) { - success = endFullScreen(); + if (m_windowManager->getWindowFound(window)) { + success = m_windowManager->removeWindow(window); + if (success) { + delete window; + } } else { - if (m_windowManager->getWindowFound(window)) { - success = m_windowManager->removeWindow(window); - if (success) { - delete window; - } - } - else { - success = GHOST_kFailure; - } + success = GHOST_kFailure; } return success; } @@ -119,83 +113,6 @@ bool GHOST_System::validWindow(GHOST_IWindow *window) return m_windowManager->getWindowFound(window); } -GHOST_TSuccess GHOST_System::beginFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow **window, - const bool stereoVisual) -{ - GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(m_windowManager, "GHOST_System::beginFullScreen(): invalid window manager"); - if (m_displayManager) { - if (!m_windowManager->getFullScreen()) { - m_displayManager->getCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, - m_preFullScreenSetting); - - // GHOST_PRINT("GHOST_System::beginFullScreen(): activating new display settings\n"); - success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, - setting); - if (success == GHOST_kSuccess) { - // GHOST_PRINT("GHOST_System::beginFullScreen(): creating full-screen window\n"); - success = createFullScreenWindow((GHOST_Window **)window, setting, stereoVisual); - if (success == GHOST_kSuccess) { - m_windowManager->beginFullScreen(*window, stereoVisual); - } - else { - m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, - m_preFullScreenSetting); - } - } - } - } - if (success == GHOST_kFailure) { - GHOST_PRINT("GHOST_System::beginFullScreen(): could not enter full-screen mode\n"); - } - return success; -} - -GHOST_TSuccess GHOST_System::updateFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow ** /*window*/) -{ - GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(m_windowManager, "GHOST_System::updateFullScreen(): invalid window manager"); - if (m_displayManager) { - if (m_windowManager->getFullScreen()) { - success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, - setting); - } - } - - return success; -} - -GHOST_TSuccess GHOST_System::endFullScreen() -{ - GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(m_windowManager, "GHOST_System::endFullScreen(): invalid window manager"); - if (m_windowManager->getFullScreen()) { - // GHOST_IWindow* window = m_windowManager->getFullScreenWindow(); - // GHOST_PRINT("GHOST_System::endFullScreen(): leaving window manager full-screen mode\n"); - if (m_windowManager->endFullScreen() == GHOST_kSuccess) { - GHOST_ASSERT(m_displayManager, "GHOST_System::endFullScreen(): invalid display manager"); - // GHOST_PRINT("GHOST_System::endFullScreen(): leaving full-screen mode\n"); - success = m_displayManager->setCurrentDisplaySetting(GHOST_DisplayManager::kMainDisplay, - m_preFullScreenSetting); - } - } - return success; -} - -bool GHOST_System::getFullScreen() -{ - bool fullScreen; - if (m_windowManager) { - fullScreen = m_windowManager->getFullScreen(); - } - else { - fullScreen = false; - } - return fullScreen; -} - GHOST_IWindow *GHOST_System::getWindowUnderCursor(int32_t x, int32_t y) { /* TODO: This solution should follow the order of the activated windows (Z-order). @@ -375,10 +292,6 @@ GHOST_TSuccess GHOST_System::init() GHOST_TSuccess GHOST_System::exit() { - if (getFullScreen()) { - endFullScreen(); - } - delete m_displayManager; m_displayManager = nullptr; @@ -399,40 +312,6 @@ GHOST_TSuccess GHOST_System::exit() return GHOST_kSuccess; } -GHOST_TSuccess GHOST_System::createFullScreenWindow(GHOST_Window **window, - const GHOST_DisplaySetting &settings, - const bool stereoVisual) -{ - GHOST_GPUSettings gpuSettings = {0}; - - if (stereoVisual) { - gpuSettings.flags |= GHOST_gpuStereoVisual; - } -#if defined(WITH_OPENGL_BACKEND) - gpuSettings.context_type = GHOST_kDrawingContextTypeOpenGL; -#elif defined(WITH_METAL_BACKEND) - gpuSettings.context_type = GHOST_kDrawingContextTypeMetal; -#elif defined(WITH_VULKAN_BACKEND) - gpuSettings.context_type = GHOST_kDrawingContextTypeVulkan; -#else -# error -#endif - /* NOTE: don't use #getCurrentDisplaySetting() because on X11 we may - * be zoomed in and the desktop may be bigger than the viewport. */ - GHOST_ASSERT(m_displayManager, - "GHOST_System::createFullScreenWindow(): invalid display manager"); - // GHOST_PRINT("GHOST_System::createFullScreenWindow(): creating full-screen window\n"); - *window = (GHOST_Window *)createWindow("", - 0, - 0, - settings.xPixels, - settings.yPixels, - GHOST_kWindowStateNormal, - gpuSettings, - true /*exclusive*/); - return (*window == nullptr) ? GHOST_kFailure : GHOST_kSuccess; -} - bool GHOST_System::useNativePixel() { m_nativePixel = true; diff --git a/intern/ghost/intern/GHOST_System.hh b/intern/ghost/intern/GHOST_System.hh index e19ce959549..51ae965c067 100644 --- a/intern/ghost/intern/GHOST_System.hh +++ b/intern/ghost/intern/GHOST_System.hh @@ -103,40 +103,6 @@ class GHOST_System : public GHOST_ISystem { */ bool validWindow(GHOST_IWindow *window) override; - /** - * Begins full screen mode. - * \param setting: The new setting of the display. - * \param window: Window displayed in full screen. - * \param stereoVisual: Stereo visual for quad buffered stereo. - * This window is invalid after full screen has been ended. - * \return Indication of success. - */ - GHOST_TSuccess beginFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow **window, - const bool stereoVisual) override; - - /** - * Updates the resolution while in full-screen mode. - * \param setting: The new setting of the display. - * \param window: Window displayed in full screen. - * - * \return Indication of success. - */ - GHOST_TSuccess updateFullScreen(const GHOST_DisplaySetting &setting, - GHOST_IWindow **window) override; - - /** - * Ends full screen mode. - * \return Indication of success. - */ - GHOST_TSuccess endFullScreen() override; - - /** - * Returns current full screen mode status. - * \return The current status. - */ - bool getFullScreen() override; - /** * Native pixel size support (MacBook 'retina'). * \return The pixel size in float. @@ -400,15 +366,6 @@ class GHOST_System : public GHOST_ISystem { */ GHOST_TSuccess exit() override; - /** - * Creates a full-screen window. - * \param window: The window created. - * \return Indication of success. - */ - GHOST_TSuccess createFullScreenWindow(GHOST_Window **window, - const GHOST_DisplaySetting &settings, - const bool stereoVisual); - /** The display manager (platform dependent). */ GHOST_DisplayManager *m_displayManager; @@ -431,9 +388,6 @@ class GHOST_System : public GHOST_ISystem { GHOST_EventPrinter *m_eventPrinter; #endif // WITH_GHOST_DEBUG - /** Settings of the display before the display went full-screen. */ - GHOST_DisplaySetting m_preFullScreenSetting; - /* Use multi-touch gestures? */ bool m_multitouchGestures; diff --git a/intern/ghost/intern/GHOST_WindowCocoa.hh b/intern/ghost/intern/GHOST_WindowCocoa.hh index a12b1ec8464..12e6151ef43 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.hh +++ b/intern/ghost/intern/GHOST_WindowCocoa.hh @@ -226,16 +226,6 @@ class GHOST_WindowCocoa : public GHOST_Window { void setNativePixelSize(); - GHOST_TSuccess beginFullScreen() const override - { - return GHOST_kFailure; - } - - GHOST_TSuccess endFullScreen() const override - { - return GHOST_kFailure; - } - /** public function to get the window containing the view */ BlenderWindow *getViewWindow() const { diff --git a/intern/ghost/intern/GHOST_WindowManager.cc b/intern/ghost/intern/GHOST_WindowManager.cc index ab78d13c70c..6ad85a7d6fb 100644 --- a/intern/ghost/intern/GHOST_WindowManager.cc +++ b/intern/ghost/intern/GHOST_WindowManager.cc @@ -15,10 +15,7 @@ #include "GHOST_Window.hh" #include -GHOST_WindowManager::GHOST_WindowManager() - : m_fullScreenWindow(nullptr), m_activeWindow(nullptr), m_activeWindowBeforeFullScreen(nullptr) -{ -} +GHOST_WindowManager::GHOST_WindowManager() : m_activeWindow(nullptr) {} /* m_windows is freed by GHOST_System::disposeWindow */ GHOST_WindowManager::~GHOST_WindowManager() = default; @@ -40,17 +37,12 @@ GHOST_TSuccess GHOST_WindowManager::removeWindow(const GHOST_IWindow *window) { GHOST_TSuccess success = GHOST_kFailure; if (window) { - if (window == m_fullScreenWindow) { - endFullScreen(); - } - else { - std::vector::iterator result = find( - m_windows.begin(), m_windows.end(), window); - if (result != m_windows.end()) { - setWindowInactive(window); - m_windows.erase(result); - success = GHOST_kSuccess; - } + std::vector::iterator result = find( + m_windows.begin(), m_windows.end(), window); + if (result != m_windows.end()) { + setWindowInactive(window); + m_windows.erase(result); + success = GHOST_kSuccess; } } return success; @@ -60,65 +52,15 @@ bool GHOST_WindowManager::getWindowFound(const GHOST_IWindow *window) const { bool found = false; if (window) { - if (getFullScreen() && (window == m_fullScreenWindow)) { + std::vector::const_iterator result = find( + m_windows.begin(), m_windows.end(), window); + if (result != m_windows.end()) { found = true; } - else { - std::vector::const_iterator result = find( - m_windows.begin(), m_windows.end(), window); - if (result != m_windows.end()) { - found = true; - } - } } return found; } -bool GHOST_WindowManager::getFullScreen() const -{ - return m_fullScreenWindow != nullptr; -} - -GHOST_IWindow *GHOST_WindowManager::getFullScreenWindow() const -{ - return m_fullScreenWindow; -} - -GHOST_TSuccess GHOST_WindowManager::beginFullScreen(GHOST_IWindow *window, bool /*stereoVisual*/) -{ - GHOST_TSuccess success = GHOST_kFailure; - GHOST_ASSERT(window, "GHOST_WindowManager::beginFullScreen(): invalid window"); - GHOST_ASSERT(window->getValid(), "GHOST_WindowManager::beginFullScreen(): invalid window"); - if (!getFullScreen()) { - m_fullScreenWindow = window; - m_activeWindowBeforeFullScreen = getActiveWindow(); - setActiveWindow(m_fullScreenWindow); - m_fullScreenWindow->beginFullScreen(); - success = GHOST_kSuccess; - } - return success; -} - -GHOST_TSuccess GHOST_WindowManager::endFullScreen() -{ - GHOST_TSuccess success = GHOST_kFailure; - if (getFullScreen()) { - if (m_fullScreenWindow != nullptr) { - // GHOST_PRINT("GHOST_WindowManager::endFullScreen(): deleting full-screen window\n"); - setWindowInactive(m_fullScreenWindow); - m_fullScreenWindow->endFullScreen(); - delete m_fullScreenWindow; - // GHOST_PRINT("GHOST_WindowManager::endFullScreen(): done\n"); - m_fullScreenWindow = nullptr; - if (m_activeWindowBeforeFullScreen) { - setActiveWindow(m_activeWindowBeforeFullScreen); - } - } - success = GHOST_kSuccess; - } - return success; -} - GHOST_TSuccess GHOST_WindowManager::setActiveWindow(GHOST_IWindow *window) { GHOST_TSuccess success = GHOST_kSuccess; diff --git a/intern/ghost/intern/GHOST_WindowManager.hh b/intern/ghost/intern/GHOST_WindowManager.hh index 340231c7143..645e484f3a3 100644 --- a/intern/ghost/intern/GHOST_WindowManager.hh +++ b/intern/ghost/intern/GHOST_WindowManager.hh @@ -50,31 +50,6 @@ class GHOST_WindowManager { */ bool getWindowFound(const GHOST_IWindow *window) const; - /** - * Returns whether one of the windows is full-screen. - * \return A boolean indicator. - */ - bool getFullScreen() const; - - /** - * Returns pointer to the full-screen window. - * \return The full-screen window (nullptr if not in full-screen). - */ - GHOST_IWindow *getFullScreenWindow() const; - - /** - * Activates full-screen mode for a window. - * \param window: The window displayed full-screen. - * \return Indication of success. - */ - GHOST_TSuccess beginFullScreen(GHOST_IWindow *window, const bool stereoVisual); - - /** - * Closes full-screen mode down. - * \return Indication of success. - */ - GHOST_TSuccess endFullScreen(); - /** * Sets new window as active window (the window receiving events). * There can be only one window active which should be in the current window list. @@ -113,14 +88,8 @@ class GHOST_WindowManager { /** The list of windows managed */ std::vector m_windows; - /** Window in full-screen state. There can be only one of this which is not in or window list. */ - GHOST_IWindow *m_fullScreenWindow; - /** The active window. */ GHOST_IWindow *m_activeWindow; - /** Window that was active before entering full-screen state. */ - GHOST_IWindow *m_activeWindowBeforeFullScreen; - MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_WindowManager") }; diff --git a/intern/ghost/intern/GHOST_WindowNULL.hh b/intern/ghost/intern/GHOST_WindowNULL.hh index 3548021083f..b312e442a67 100644 --- a/intern/ghost/intern/GHOST_WindowNULL.hh +++ b/intern/ghost/intern/GHOST_WindowNULL.hh @@ -138,15 +138,6 @@ class GHOST_WindowNULL : public GHOST_Window { return GHOST_kSuccess; } - GHOST_TSuccess beginFullScreen() const override - { - return GHOST_kSuccess; - } - GHOST_TSuccess endFullScreen() const override - { - return GHOST_kSuccess; - } - private: /** * \param type: The type of rendering context create. diff --git a/intern/ghost/intern/GHOST_WindowSDL.hh b/intern/ghost/intern/GHOST_WindowSDL.hh index bd1f41b1c4a..32e2f0eaac1 100644 --- a/intern/ghost/intern/GHOST_WindowSDL.hh +++ b/intern/ghost/intern/GHOST_WindowSDL.hh @@ -117,16 +117,5 @@ class GHOST_WindowSDL : public GHOST_Window { return GHOST_kSuccess; } - // TODO - GHOST_TSuccess beginFullScreen() const override - { - return GHOST_kFailure; - } - - GHOST_TSuccess endFullScreen() const override - { - return GHOST_kFailure; - } - uint16_t getDPIHint() override; }; diff --git a/intern/ghost/intern/GHOST_WindowWayland.cc b/intern/ghost/intern/GHOST_WindowWayland.cc index 8bdfe52955c..52891609aa7 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cc +++ b/intern/ghost/intern/GHOST_WindowWayland.cc @@ -2452,43 +2452,6 @@ GHOST_TSuccess GHOST_WindowWayland::setOrder(GHOST_TWindowOrder order) return GHOST_kSuccess; } -GHOST_TSuccess GHOST_WindowWayland::beginFullScreen() const -{ -#ifdef USE_EVENT_BACKGROUND_THREAD - std::lock_guard lock_server_guard{*system_->server_mutex}; -#endif - -#ifdef WITH_GHOST_WAYLAND_LIBDECOR - if (use_libdecor) { - libdecor_frame_set_fullscreen(window_->libdecor->frame, nullptr); - } - else -#endif - { - xdg_toplevel_set_fullscreen(window_->xdg_decor->toplevel, nullptr); - } - - return GHOST_kSuccess; -} - -GHOST_TSuccess GHOST_WindowWayland::endFullScreen() const -{ -#ifdef USE_EVENT_BACKGROUND_THREAD - std::lock_guard lock_server_guard{*system_->server_mutex}; -#endif - -#ifdef WITH_GHOST_WAYLAND_LIBDECOR - if (use_libdecor) { - libdecor_frame_unset_fullscreen(window_->libdecor->frame); - } - else -#endif - { - xdg_toplevel_unset_fullscreen(window_->xdg_decor->toplevel); - } - return GHOST_kSuccess; -} - bool GHOST_WindowWayland::isDialog() const { return window_->is_dialog; diff --git a/intern/ghost/intern/GHOST_WindowWayland.hh b/intern/ghost/intern/GHOST_WindowWayland.hh index d669b7632fb..b89aa35e34c 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.hh +++ b/intern/ghost/intern/GHOST_WindowWayland.hh @@ -136,10 +136,6 @@ class GHOST_WindowWayland : public GHOST_Window { GHOST_TSuccess setOrder(GHOST_TWindowOrder order) override; - GHOST_TSuccess beginFullScreen() const override; - - GHOST_TSuccess endFullScreen() const override; - bool isDialog() const override; #ifdef WITH_INPUT_IME diff --git a/intern/ghost/intern/GHOST_WindowWin32.hh b/intern/ghost/intern/GHOST_WindowWin32.hh index a9d1fb24d95..eb2b83dbb94 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.hh +++ b/intern/ghost/intern/GHOST_WindowWin32.hh @@ -291,16 +291,6 @@ class GHOST_WindowWin32 : public GHOST_Window { */ GHOST_TabletData getTabletData(); - GHOST_TSuccess beginFullScreen() const - { - return GHOST_kFailure; - } - - GHOST_TSuccess endFullScreen() const - { - return GHOST_kFailure; - } - void updateDPI(); uint16_t getDPIHint() override; diff --git a/intern/ghost/intern/GHOST_WindowX11.cc b/intern/ghost/intern/GHOST_WindowX11.cc index 177f1496bfe..6b73f2da000 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cc +++ b/intern/ghost/intern/GHOST_WindowX11.cc @@ -1496,58 +1496,6 @@ GHOST_TSuccess GHOST_WindowX11::setWindowCustomCursorShape(uint8_t *bitmap, return GHOST_kSuccess; } -GHOST_TSuccess GHOST_WindowX11::beginFullScreen() const -{ - { - Window root_return; - int x_return, y_return; - uint w_return, h_return, border_w_return, depth_return; - - XGetGeometry(m_display, - m_window, - &root_return, - &x_return, - &y_return, - &w_return, - &h_return, - &border_w_return, - &depth_return); - - m_system->setCursorPosition(w_return / 2, h_return / 2); - } - - /* Grab Keyboard & Mouse */ - int err; - - err = XGrabKeyboard(m_display, m_window, False, GrabModeAsync, GrabModeAsync, CurrentTime); - if (err != GrabSuccess) { - printf("XGrabKeyboard failed %d\n", err); - } - - err = XGrabPointer(m_display, - m_window, - False, - PointerMotionMask | ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, - GrabModeAsync, - m_window, - None, - CurrentTime); - if (err != GrabSuccess) { - printf("XGrabPointer failed %d\n", err); - } - - return GHOST_kSuccess; -} - -GHOST_TSuccess GHOST_WindowX11::endFullScreen() const -{ - XUngrabKeyboard(m_display, CurrentTime); - XUngrabPointer(m_display, CurrentTime); - - return GHOST_kSuccess; -} - uint16_t GHOST_WindowX11::getDPIHint() { /* Try to read DPI setting set using xrdb */ diff --git a/intern/ghost/intern/GHOST_WindowX11.hh b/intern/ghost/intern/GHOST_WindowX11.hh index 9ced9106d6e..f8393aacf2a 100644 --- a/intern/ghost/intern/GHOST_WindowX11.hh +++ b/intern/ghost/intern/GHOST_WindowX11.hh @@ -154,10 +154,6 @@ class GHOST_WindowX11 : public GHOST_Window { bool m_post_init; GHOST_TWindowState m_post_state; - GHOST_TSuccess beginFullScreen() const override; - - GHOST_TSuccess endFullScreen() const override; - GHOST_TSuccess setDialogHints(GHOST_WindowX11 *parentWindow); uint16_t getDPIHint() override; diff --git a/intern/ghost/test/gears/GHOST_C-Test.c b/intern/ghost/test/gears/GHOST_C-Test.c index 7f472d26452..0bdd05f8ba8 100644 --- a/intern/ghost/test/gears/GHOST_C-Test.c +++ b/intern/ghost/test/gears/GHOST_C-Test.c @@ -41,7 +41,6 @@ static GHOST_SystemHandle shSystem = NULL; static GHOST_WindowHandle sMainWindow = NULL; static GHOST_WindowHandle sSecondaryWindow = NULL; static GHOST_TStandardCursor sCursor = GHOST_kStandardCursorFirstCursor; -static GHOST_WindowHandle sFullScreenWindow = NULL; static GHOST_TimerTaskHandle sTestTimer; static GHOST_TimerTaskHandle sGearsTimer; @@ -316,41 +315,12 @@ bool processEvent(GHOST_EventHandle hEvent, GHOST_TUserDataPtr userData) GHOST_SetCursorShape(window, sCursor); break; } - case GHOST_kKeyF: - if (!GHOST_GetFullScreen(shSystem)) { - /* Begin full-screen mode. */ - setting.bpp = 24; - setting.frequency = 85; - setting.xPixels = 640; - setting.yPixels = 480; - - /* - * setting.bpp = 16; - * setting.frequency = 75; - * setting.xPixels = 640; - * setting.yPixels = 480; - */ - - sFullScreenWindow = GHOST_BeginFullScreen(shSystem, - &setting, - - FALSE /* stereo flag */); - } - else { - GHOST_EndFullScreen(shSystem); - sFullScreenWindow = 0; - } - break; case GHOST_kKeyH: { visibility = GHOST_GetCursorVisibility(window); GHOST_SetCursorVisibility(window, !visibility); break; } case GHOST_kKeyQ: - if (GHOST_GetFullScreen(shSystem)) { - GHOST_EndFullScreen(shSystem); - sFullScreenWindow = 0; - } sExitRequested = 1; case GHOST_kKeyT: if (!sTestTimer) { @@ -499,13 +469,7 @@ static void gearsTimerProc(GHOST_TimerTaskHandle hTask, uint64_t time) fAngle += 2.0; view_roty += 1.0; hWindow = (GHOST_WindowHandle)GHOST_GetTimerTaskUserData(hTask); - if (GHOST_GetFullScreen(shSystem)) { - /* Running full screen */ - GHOST_InvalidateWindow(sFullScreenWindow); - } - else { - if (GHOST_ValidWindow(shSystem, hWindow)) { - GHOST_InvalidateWindow(hWindow); - } + if (GHOST_ValidWindow(shSystem, hWindow)) { + GHOST_InvalidateWindow(hWindow); } } diff --git a/intern/ghost/test/gears/GHOST_Test.cpp b/intern/ghost/test/gears/GHOST_Test.cpp index 5c2409a12f0..0ea87408360 100644 --- a/intern/ghost/test/gears/GHOST_Test.cpp +++ b/intern/ghost/test/gears/GHOST_Test.cpp @@ -388,7 +388,6 @@ class Application : public GHOST_IEventConsumer { GHOST_ISystem *m_system; GHOST_IWindow *m_mainWindow; GHOST_IWindow *m_secondaryWindow; - GHOST_IWindow *m_fullScreenWindow; GHOST_ITimerTask *m_gearsTimer, *m_testTimer; GHOST_TStandardCursor m_cursor; bool m_exitRequested; @@ -400,7 +399,6 @@ Application::Application(GHOST_ISystem *system) : m_system(system), m_mainWindow(0), m_secondaryWindow(0), - m_fullScreenWindow(0), m_gearsTimer(0), m_testTimer(0), m_cursor(GHOST_kStandardCursorFirstCursor), @@ -492,23 +490,6 @@ bool Application::processEvent(const GHOST_IEvent *event) break; } - case GHOST_kKeyF: - if (!m_system->getFullScreen()) { - // Begin fullscreen mode - GHOST_DisplaySetting setting; - - setting.bpp = 16; - setting.frequency = 50; - setting.xPixels = 640; - setting.yPixels = 480; - m_system->beginFullScreen(setting, &m_fullScreenWindow, false /* stereo flag */); - } - else { - m_system->endFullScreen(); - m_fullScreenWindow = 0; - } - break; - case GHOST_kKeyH: window->setCursorVisibility(!window->getCursorVisibility()); break; @@ -543,10 +524,6 @@ bool Application::processEvent(const GHOST_IEvent *event) } case GHOST_kKeyQ: - if (m_system->getFullScreen()) { - m_system->endFullScreen(); - m_fullScreenWindow = 0; - } m_exitRequested = true; break; @@ -718,13 +695,7 @@ static void gearsTimerProc(GHOST_ITimerTask *task, uint64_t /*time*/) fAngle += 2.0; view_roty += 1.0; GHOST_IWindow *window = (GHOST_IWindow *)task->getUserData(); - if (fApp->m_fullScreenWindow) { - // Running full screen - fApp->m_fullScreenWindow->invalidate(); - } - else { - if (fSystem->validWindow(window)) { - window->invalidate(); - } + if (fSystem->validWindow(window)) { + window->invalidate(); } }