[Wayland-bugs] [Bug 775099] Shell search provider doesn't work with Wayland

gnome-shell (GNOME Bugzilla) bugzilla at gnome.org
Thu May 11 02:48:10 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=775099

--- Comment #16 from Daiki Ueno <dueno at src.gnome.org> ---
(In reply to Florian Müllner from comment #14)
> Review of attachment 350958 [details] [review]:
> 
> The commit message is poorly worded - "respect foo property" sounds like
> there was a well-established field that we failed to support, rather than
> something newly made-up. And of course a search provider keyfile is not a
> .desktop file ...

Thank you for the review.

> ::: js/ui/search.js
> @@ +184,2 @@
>      _activateResult: function(result, id) {
>          this.provider.activateResult(id, this._terms);
> 
> Does this make sense, or should we assume that if copyResult is set, then
> the app uses the activate-copies pattern?

I think it still makes sense to call activateResult, even if a search provider
wants to copy the result to clipboard, because it allows the search provider to
track the activated result as "recently used".

> @@ +185,3 @@
>          this.provider.activateResult(id, this._terms);
> +        if (this.provider.copyResult)
> +            this._clipboard.set_text(St.ClipboardType.CLIPBOARD, id);
> 
> Of course this doesn't copy the result, but its ID. While I don't know about
> any other search provider that uses the activate-copies pattern, this looks
> needlessly restrictive.
> 
> Maybe something like:
> 
>   activateResult: function(id, terms) {
>       if (this.copyResult)
>           this.proxy.GetResultClipboardTextRemote(id, (text, error) => {
>               this._clipboard.set_text(St.ClipboardType.CLIPBOARD, text);
>           });
>       else
>           this.proxy.ActivateResultRemote(id, terms,
> global.get_current_time());
>   },

I guess it could reuse GetResultMetas, which is already called before
ActivateResult, instead of adding a new method.  And in that case, we don't
even need CopyResult keyword in .ini file anymore, because we can simply check
a certain property ("clipboardText" in the patch in comment 15) is set in the
result meta.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20170511/be523f7d/attachment.html>


More information about the wayland-bugs mailing list