From 1909347c82fe15e18bbe4ea58c097565c1389358 Mon Sep 17 00:00:00 2001
From: guinux <nuxgui@gmail.com>
Date: Sat, 1 Sep 2018 09:53:04 +0200
Subject: [PATCH] fix #466

---
 src/manager_window.vala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/manager_window.vala b/src/manager_window.vala
index 87edab7d..d4c4ee15 100644
--- a/src/manager_window.vala
+++ b/src/manager_window.vala
@@ -1853,7 +1853,6 @@ namespace Pamac {
 				case 0: // repos
 					Timeout.add (200, () => {
 						search_entry.grab_focus_without_selecting ();
-						search_entry.set_position (-1);
 						return false;
 					});
 					if (search_string == null) {
@@ -1871,7 +1870,6 @@ namespace Pamac {
 				case 1: // aur
 					Timeout.add (200, () => {
 						search_entry.grab_focus_without_selecting ();
-						search_entry.set_position (-1);
 						return false;
 					});
 					if (search_string == null) {
@@ -2131,8 +2129,10 @@ namespace Pamac {
 					return;
 				}
 				Timeout.add (200, () => {
-					search_entry.grab_focus_without_selecting ();
-					search_entry.set_position (-1);
+					if (!search_entry.has_focus) {
+						search_entry.grab_focus_without_selecting ();
+						search_entry.set_position (-1);
+					}
 					return false;
 				});
 				switch (origin_stack.visible_child_name) {
-- 
GitLab