# HG changeset patch # User frosch # Date 2013-08-03 21:26:49 # Node ID d49b35458da110c34db50c085940de540ae28c61 # Parent b30ba2d251c6d31f302cb07825b38a84feafdddb (svn r25647) -Add: If an editbox is configured to be cleared with ESC, but the editbox is already empty, unselect the editbox instead. diff --git a/src/window.cpp b/src/window.cpp --- a/src/window.cpp +++ b/src/window.cpp @@ -2429,9 +2429,14 @@ EventState Window::HandleEditBoxKey(int break; case QueryString::ACTION_CLEAR: - query->text.DeleteAll(); - this->SetWidgetDirty(wid); - this->OnEditboxChanged(wid); + if (query->text.bytes <= 1) { + /* If already empty, unfocus instead */ + this->UnfocusFocusedWidget(); + } else { + query->text.DeleteAll(); + this->SetWidgetDirty(wid); + this->OnEditboxChanged(wid); + } break; default: