From 3ec08098ee70dc0d6ed540af172566e420ea7dc7 Mon Sep 17 00:00:00 2001 From: marty28 Date: Tue, 27 Feb 2018 21:45:37 +1300 Subject: [PATCH] Fixed dialogs not closing. Clear the screen properly before fullscreen render - Dialogs now close. - Sorted clearing the screen before fullscreen render (no more RGB flashes!). --- xbmc360/guilib/GUIDialog.cpp | 8 ++++++-- xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp | 14 ++++++++++++++ xbmc360/guilib/dialogs/GUIDialogButtonMenu.h | 2 ++ xbmc360/guilib/windows/GUIWindowFullScreen.cpp | 7 +++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/xbmc360/guilib/GUIDialog.cpp b/xbmc360/guilib/GUIDialog.cpp index bd7fe9a7..9e08605d 100644 --- a/xbmc360/guilib/GUIDialog.cpp +++ b/xbmc360/guilib/GUIDialog.cpp @@ -48,13 +48,13 @@ bool CGUIDialog::OnMessage(CGUIMessage& message) // if we were running, make sure we remove ourselves from the window manager if (m_bRunning) { - if (/*m_bModal*/1) + if (/*m_bModal*/1) //TODO { g_windowManager.UnRoute(GetID()); } else { -// g_windowManager.RemoveModeless( GetID() ); +// g_windowManager.RemoveModeless( GetID() ); //TODO } // m_pParentWindow = NULL; @@ -115,5 +115,9 @@ void CGUIDialog::Close(bool forceClose /*= false*/) // g_audioManager.PlayWindowSound(GetID(), SOUND_DEINIT); CGUIMessage msg(GUI_MSG_WINDOW_DEINIT, 0, 0); + +#if 0 // FIXME : Why is it calling the base class? OnMessage(msg); +#endif + CGUIDialog::OnMessage(msg); } diff --git a/xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp b/xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp index e46c2e96..2a126994 100644 --- a/xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp +++ b/xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp @@ -7,4 +7,18 @@ CGUIDialogButtonMenu::CGUIDialogButtonMenu(void) CGUIDialogButtonMenu::~CGUIDialogButtonMenu(void) { +} + +bool CGUIDialogButtonMenu::OnMessage(CGUIMessage& message) +{ + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + { + Close(); + } + break; + } + + return CGUIWindow::OnMessage(message); } \ No newline at end of file diff --git a/xbmc360/guilib/dialogs/GUIDialogButtonMenu.h b/xbmc360/guilib/dialogs/GUIDialogButtonMenu.h index a0df6028..c551b3ee 100644 --- a/xbmc360/guilib/dialogs/GUIDialogButtonMenu.h +++ b/xbmc360/guilib/dialogs/GUIDialogButtonMenu.h @@ -8,6 +8,8 @@ class CGUIDialogButtonMenu : public CGUIDialog public: CGUIDialogButtonMenu(void); virtual ~CGUIDialogButtonMenu(void); + + virtual bool OnMessage(CGUIMessage& message); }; #endif //GUILIB_CGUIDIALOGBUTTONMENU_H \ No newline at end of file diff --git a/xbmc360/guilib/windows/GUIWindowFullScreen.cpp b/xbmc360/guilib/windows/GUIWindowFullScreen.cpp index c4fd200c..bda9dbbc 100644 --- a/xbmc360/guilib/windows/GUIWindowFullScreen.cpp +++ b/xbmc360/guilib/windows/GUIWindowFullScreen.cpp @@ -61,6 +61,10 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message) CGUIWindow::OnMessage(message); + g_graphicsContext.Lock(); + g_graphicsContext.Get3DDevice()->Clear( 0L, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0L ); + g_graphicsContext.Unlock(); + // switch resolution CSingleLock lock (g_graphicsContext); g_graphicsContext.SetFullScreenVideo(true); @@ -77,12 +81,15 @@ bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message) FreeResources(true); CSingleLock lock (g_graphicsContext); + g_graphicsContext.SetFullScreenVideo(false); lock.Leave(); // make sure renderer is uptospeed // g_renderManager.Update(false); + Sleep(100); + return true; } case GUI_MSG_SETFOCUS: