Re: Middle click paste in St.Entry






On Tue, Jul 8, 2014 at 1:34 PM, Emmanuele Bassi <ebassi gmail com> wrote:
except that the source actor in the event will be wrong, and if I
added a check for that inside clutter_actor_event() (something which
would make sense for me to add) then you'd get a warning and the event
would be rejected.

you'd have to synthesize a new event from the one passed, though to be
fair that's be a fairly evil thing to do.

For reference, we already do this to re-type key events into the search field into the overview. Feel free to recommend a better way for us to do this though:

https://git.gnome.org/browse/gnome-shell/tree/js/ui/viewSelector.js#n509
 
if you want to handle middle-click-to-paste by middle-clicking
anywhere other than an entry (something I honestly don't think would
be good to have), then you should connect to the button-release-event
on that other actor, and do what StEntry does when it receives a
middle click. maybe even add a method to StEntry to paste the contents
from a specific clipboard into its text buffer.

ciao,
 Emmanuele.


On 8 July 2014 17:47, Florian Müllner <fmuellner gnome org> wrote:
> On Tue, Jul 8, 2014 at 6:31 PM, Sam Bull <sam hacking sent com> wrote:
>> Ah, that makes sense. Is there any way that might be fixed? When
>> clicking anywhere else on the note, the code is simply:
>>
>>         this._box.connect('button-press-event', function () {
>>             clutterText.grab_key_focus();
>>         });
>>
>> Is there any way to propagate the middle click through?
>
>
> Not very pretty, but something like this should work:
>
>          this._box.connect('button-press-event', function (actor, event) {
>              clutterText.event(event, false);
>          });
> _______________________________________________
> gnome-shell-list mailing list
> gnome-shell-list gnome org
> https://mail.gnome.org/mailman/listinfo/gnome-shell-list



--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/
_______________________________________________
gnome-shell-list mailing list
gnome-shell-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list



--
  Jasper


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