Skip to content

Commit

Permalink
UI|Client: Halt UI updates when application is shutting down
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 19, 2017
1 parent 174dcab commit 94bbf61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions doomsday/apps/client/include/ui/clientrootwidget.h
Expand Up @@ -34,9 +34,11 @@ class ClientRootWidget : public de::GuiRootWidget

ClientWindow &window();

void addOnTop(de::GuiWidget *widget);
void dispatchLatestMousePosition();
void handleEventAsFallback(de::Event const &event);
void update() override;

void addOnTop(de::GuiWidget *widget) override;
void dispatchLatestMousePosition() override;
void handleEventAsFallback(de::Event const &event) override;
};

#endif // DENG_CLIENTROOTWIDGET_H
8 changes: 8 additions & 0 deletions doomsday/apps/client/src/ui/clientrootwidget.cpp
Expand Up @@ -33,6 +33,14 @@ ClientWindow &ClientRootWidget::window()
return GuiRootWidget::window().as<ClientWindow>();
}

void ClientRootWidget::update()
{
if (!DoomsdayApp::app().isShuttingDown())
{
GuiRootWidget::update();
}
}

void ClientRootWidget::addOnTop(GuiWidget *widget)
{
// The window knows what is the correct top to add to.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/widgets/gamewidget.cpp
Expand Up @@ -281,7 +281,7 @@ void GameWidget::update()
{
GuiWidget::update();

if (DoomsdayApp::app().isShuttingDown() || isDisabled() || BusyMode_Active()) return;
if (isDisabled() || BusyMode_Active()) return;

// We may be performing GL operations.
ClientWindow::main().glActivate();
Expand Down

0 comments on commit 94bbf61

Please sign in to comment.