Login  Register

Re: Pharo and X11 primary selection (aka middle mouse button paste)

Posted by stepharo on Jan 24, 2015; 9:31pm
URL: https://forum.world.st/Pharo-and-X11-primary-selection-aka-middle-mouse-button-paste-tp4800635p4801441.html

Hi pieter
> Hi,
>
> Thanks very much - "--textenc UTF-8" works for us!
>
> For the sake of others with the same issue reading this in the archives, I
> just want to be pedantic and  point out that I doubt "--textenc UTF-8" is
> some magic panacea that will work for all systems.
Obviously.
Pieter do you really think that we are satisfied with the situation?
No certainly not. Now do you imagine the huge todo we have?

If your team is using Pharo then it may be good to think that this is
also your system
and you can help you and us.

> The issue seems to be that the encoding Pharo uses should match that of
> the surrounding system, which, for us, happens to be UTF-8 but could be
> different for others.
Indeed.
> I was a bit sloppy when I spoke of "middle button paste". I don't mean
> that the Pharo's paste command should be bound to the middle mouse button.
> I meant that Pharo should be able to paste the type of X11 selection
> (primary selection) that some other apps like terminals traditionally
> paste when you press the middle button.
We started to add SDL and we should do a large pass on the events in the
future.
But time is scarced

>
> And that is still not implemented: I need to explicitly press "Copy" in
> Chrome before it is pasted to Pharo, just highlighting the text does not
> work.
>
>> Hi,
>>
>> try setting the encoding of pharo to unicode when launching from command
>> line and see if that fixes your problem:
>> --textenc UTF-8
>>
>> The default encoding is not unicode which messes pasting from some
>> applications (e.g. Google Chrome 35+).
>> As far as middle mouse button pasting goes I do not believe Pharo supports
>> it - at least I haven't found any code related to it (although I would
>> love
>> to have this functionality).
>>
>> Peter
>>
>> On Tue, Jan 20, 2015 at 2:58 PM, Pieter Nagel <[hidden email]> wrote:
>>
>>> Our team is very frustrated with figuring out how copy & paste is
>>> supposed
>>> to work in Pharo 3 under X11.
>>>
>>> Maybe there's something we misunderstand, or can configure?
>>>
>>> We can't copy and paste text directly from other X11 apps into Pharo. We
>>> need to first paste the text into text editors like GEdit or XEmacs, and
>>> then we can copy and paste the text from there into Pharo.
>>>
>>> I think this has something to do with X11's complicated model of primary
>>> vs. clipboard selection. The primary selection is typically created by
>>> just highlighting some text, and then (by common convention) can be
>>> pasted
>>> from by just pressing the middle mouse button. The clipboard selection
>>> is
>>> typically created by explicitly using Copy or Cut commands.
>>>
>>> Strange thing is, if we start with text in (for example) Google Chrome,
>>> then neither type of selection can be pasted into Pharo. If we start
>>> with
>>> text in (for example) GEdit, then both types of selection can be pasted
>>> into Pharo.
>>>
>>> We're using Unity under Ubuntu 12.04, if that makes a difference.
>>>
>>> Advice?
>>>
>>> Thanks.
>>>
>>>
>>>
>
>
>