Skip to content

Commit

Permalink
Invalidate all windows again on DRAW_ALL_EVENT
Browse files Browse the repository at this point in the history
Fixes #2159.
  • Loading branch information
jyrkive authored and GregoryLundberg committed Nov 30, 2017
1 parent 45b391e commit 94ed535
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/gui/core/event/handler.cpp
Expand Up @@ -171,6 +171,7 @@ class sdl_event_handler : public events::sdl_handler
/** Fires a draw event. */
using events::sdl_handler::draw;
void draw();
void draw_everything();

/**
* Fires a video resize event.
Expand Down Expand Up @@ -381,8 +382,9 @@ void sdl_event_handler::handle_event(const SDL_Event& event)
case DRAW_EVENT:
draw();
break;

case DRAW_ALL_EVENT:
draw();
draw_everything();
break;

case TIMER_EVENT:
Expand Down Expand Up @@ -540,6 +542,15 @@ void sdl_event_handler::draw()
}
}

void sdl_event_handler::draw_everything()
{
for(auto dispatcher : dispatchers_) {
dynamic_cast<widget&>(*dispatcher).set_is_dirty(true);
}

draw();
}

void sdl_event_handler::video_resize(const point& new_size)
{
DBG_GUI_E << "Firing: " << SDL_VIDEO_RESIZE << ".\n";
Expand Down

0 comments on commit 94ed535

Please sign in to comment.