Просмотр исходного кода

Focus an empty URL bar when the browser starts

Keep the home start page, but clear the address bar instead of showing
about:home and give the URL field focus so typing works immediately.  A
browser launched with a URL argument still shows that URL.
Johannes Zellner 1 неделя назад
Родитель
Сommit
17d1108e39
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      browser.c

+ 7 - 2
browser.c

@@ -4137,10 +4137,15 @@ void _start(const char *arg)
 	page_scroll.offset = 0;
 	page_scroll.offset = 0;
 	page_scroll.content_h = 0;
 	page_scroll.content_h = 0;
 
 
-	if (arg && arg[0])
+	if (arg && arg[0]) {
 		navigate(arg, 1);
 		navigate(arg, 1);
-	else
+	} else {
 		load_home(1);
 		load_home(1);
+		/* Start ready to type: keep the home page, but leave the address
+		 * bar empty instead of showing "about:home". */
+		ngui_input_set(&url_in, "");
+		ngui_set_focus(&ui, ID_URL);
+	}
 
 
 	for (;;) {
 	for (;;) {
 		unsigned int action = 0;
 		unsigned int action = 0;