Ensure that focus handling stays the same as before the fix

This commit is contained in:
Andreas Löf 2016-07-17 22:52:09 +12:00
parent 501eb60743
commit 9550c3636b

View File

@ -59,7 +59,7 @@ bool context::remove_handler(sdl_handler* ptr)
// so look there first, otherwise do a complete search.
if(handlers.back() == ptr) {
if(focused_handler != handlers.end() && *focused_handler == ptr) {
focused_handler != handlers.begin() ? --focused_handler : ++focused_handler;
focused_handler = handlers.end();
}
handlers.pop_back();