summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/root.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 780dc6e7..9e264993 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -1034,7 +1034,14 @@ static iBool handleSearchBarCommands_(iWidget *searchBar, const char *cmd) {
1034 else if (equal_Command(cmd, "focus.gained")) { 1034 else if (equal_Command(cmd, "focus.gained")) {
1035 if (pointer_Command(cmd) == findChild_Widget(searchBar, "find.input")) { 1035 if (pointer_Command(cmd) == findChild_Widget(searchBar, "find.input")) {
1036 if (!isVisible_Widget(searchBar)) { 1036 if (!isVisible_Widget(searchBar)) {
1037 /* InputWidget will unfocus itself if there isn't enough space for editing
1038 text. A collapsed widget will not have been arranged yet, so on the first
1039 time the widget will just be unfocused immediately. */
1040 const iBool wasArranged = area_Rect(bounds_Widget(searchBar)) > 0;
1037 showCollapsed_Widget(searchBar, iTrue); 1041 showCollapsed_Widget(searchBar, iTrue);
1042 if (!wasArranged) {
1043 postCommand_App("focus.set id:find.input");
1044 }
1038 } 1045 }
1039 } 1046 }
1040 } 1047 }