Skip to content

Commit

Permalink
Fixed dialogs not closing. Clear the screen properly before fullscree…
Browse files Browse the repository at this point in the history
…n render

- Dialogs now close.
- Sorted clearing the screen before fullscreen render (no more RGB flashes!).
  • Loading branch information
PuxleyMartin committed Feb 27, 2018
1 parent 005c520 commit 3ec0809
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xbmc360/guilib/GUIDialog.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
14 changes: 14 additions & 0 deletions xbmc360/guilib/dialogs/GUIDialogButtonMenu.cpp
Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions xbmc360/guilib/dialogs/GUIDialogButtonMenu.h
Expand Up @@ -8,6 +8,8 @@ class CGUIDialogButtonMenu : public CGUIDialog
public:
CGUIDialogButtonMenu(void);
virtual ~CGUIDialogButtonMenu(void);

virtual bool OnMessage(CGUIMessage& message);
};

#endif //GUILIB_CGUIDIALOGBUTTONMENU_H
7 changes: 7 additions & 0 deletions xbmc360/guilib/windows/GUIWindowFullScreen.cpp
Expand Up @@ -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);
Expand All @@ -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:
Expand Down

0 comments on commit 3ec0809

Please sign in to comment.