<html>
    <head>
      <base href="https://bugzilla.gnome.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Shell search provider doesn't work with Wayland"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=775099#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Shell search provider doesn't work with Wayland"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=775099">bug 775099</a>
              from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=dueno%40src.gnome.org" title="Daiki Ueno <dueno@src.gnome.org>"> <span class="fn">Daiki Ueno</span></a>
</span></b>
        <pre>(In reply to Florian Müllner from <a href="show_bug.cgi?id=775099#c14">comment #14</a>)
<span class="quote">> Review of <span class="bz_obsolete"><a href="attachment.cgi?id=350958&action=diff" name="attach_350958" title="remoteSearch: respect "CopyResult" in desktop file">attachment 350958</a> <a href="attachment.cgi?id=350958&action=edit" title="remoteSearch: respect "CopyResult" in desktop file">[details]</a></span> <a href='review?bug=775099&attachment=350958'>[review]</a> [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 ...</span >

Thank you for the review.

<span class="quote">> ::: 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?</span >

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".

<span class="quote">> @@ +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());
>   },</span >

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 <a href="show_bug.cgi?id=775099#c15">comment 15</a>) is set in the
result meta.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>