Skip to content

Commit

Permalink
Lua Console: prevent bad window redraw when commands such as wesnoth.…
Browse files Browse the repository at this point in the history
…zoom are used
  • Loading branch information
Vultraz committed Apr 25, 2017
1 parent 3de10e5 commit 347fdd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gui/dialogs/lua_interpreter.cpp
Expand Up @@ -506,7 +506,7 @@ void lua_interpreter::controller::handle_clear_button_clicked(window & /*window*
void lua_interpreter::controller::input_keypress_callback(bool& handled,
bool& halt,
const SDL_Keycode key,
window& /*window*/)
window& window)
{
assert(lua_model_);
assert(text_entry);
Expand All @@ -517,6 +517,11 @@ void lua_interpreter::controller::input_keypress_callback(bool& handled,
execute();
handled = true;
halt = true;

// Commands such as `wesnoth.zoom` might cause the display to redraw and leave the window half-drawn.
// This preempts that.
window.set_is_dirty(true);

LOG_LUA << "finished executing\n";
} else if(key == SDLK_TAB) { // handle tab completion
tab();
Expand All @@ -539,7 +544,6 @@ void lua_interpreter::controller::input_keypress_callback(bool& handled,
handled = true;
halt = true;
}

}

void lua_interpreter::controller::execute()
Expand Down

0 comments on commit 347fdd4

Please sign in to comment.