[gnome-shell] viewSelector: Only reset search entry if it has key focus



commit 5f10047b5894b0bdba46439ee1f0e7af9f758a55
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sun Aug 18 12:49:42 2019 +0200

    viewSelector: Only reset search entry if it has key focus
    
    If the search entry does not have any text typed in and a button press
    happens outside of the search entry, we set key focus to NULL to make
    the search entry appear unfocused.
    
    This is quite intrusive and can easily cause unwanted focus changes, so
    change the captured-event handler to only call `reset()` if the search
    entry actually is focused.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/683

 js/ui/viewSelector.js | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index df69adfccb..4e82c4968b 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -577,6 +577,7 @@ var ViewSelector = class {
         if (event.type() == Clutter.EventType.BUTTON_PRESS) {
             let source = event.get_source();
             if (source != this._text &&
+                this._text.has_key_focus() &&
                 this._text.text == '' &&
                 !this._text.has_preedit () &&
                 !Main.layoutManager.keyboardBox.contains(source)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]