From dc0f286fe9660a845b0d299545cc74b30f87d0d7 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Feb 2022 13:10:30 +0100 Subject: [PATCH] searchController: Query stage for target actor instead of event.get_source() Events are going to stop containing the destinatary, so stop using this API. Querying the stage is equivalent and ensured to be up-to-date. Part-of: --- js/ui/searchController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/searchController.js b/js/ui/searchController.js index 5d25897c7..ac22439a4 100644 --- a/js/ui/searchController.js +++ b/js/ui/searchController.js @@ -306,12 +306,12 @@ var SearchController = GObject.registerClass({ _onCapturedEvent(actor, event) { if (event.type() === Clutter.EventType.BUTTON_PRESS) { - let source = event.get_source(); - if (source !== this._text && + const targetActor = global.stage.get_event_actor(event); + if (targetActor !== this._text && this._text.has_key_focus() && this._text.text === '' && !this._text.has_preedit() && - !Main.layoutManager.keyboardBox.contains(source)) { + !Main.layoutManager.keyboardBox.contains(targetActor)) { // the user clicked outside after activating the entry, but // with no search term entered and no keyboard button pressed // - cancel the search