Closed legluondunet closed 13 years ago
I'll think about how this can be done. BTW, Why do you think this is necessary? (I ask only because I never used it when I was a parcellite user, so I don't know what it's good for) Do you think the selection contents should be kept on sync with the clipboard contents, or separate?
In fact, I think it's fast to select a line then middle click of the mouse to copy text and I could paste it with another middle click whereever I want.It's specific to Linux. I think the selection content should be kept in the history.
OK. Do you think the "Control-C"-style clipboard contents should be accessible for the middle button click paste too? (I mean: you copy something with Control-C and then use the middle button to paste it somewhere; and if the selection gets overwritten, it should still appear in the history menu).
yes, good like this.
As an update, I'm working on this. It has taken me this long because I had to restructure the code due to the memory leak bug first.
I've implemented this in the "primary" branch (/http://github.com/fmoralesc/pastie/tree/primary). You can enable the primary selection via the preferences dialog. Please test and comment.
Could you tell me how to test primary branch? I test pastie from PPA or GIT? What is the command line to download it from git?
Thanks.
You con download a tarball from http://github.com/fmoralesc/pastie/tarball/primary
You should then run pastie from the folder you extracted the tarball into (you might need to give execution permission to the "pastie" file).
Using git: git clone git@github.com:fmoralesc/pastie.git cd pastie git checkout -b primary origin/primary And then run pastie from there.
So... any comments on this? How has testing gone?
I use it for one week and something is very annoying: the x copy are multiple and finally historic becomes useless... Look at this screenshot, more than words: http://img834.imageshack.us/img834/5366/copieecran0508201008180.jpg
I see. What program are you copying text from? How fast are you selecting the text? Pastie has two ways of getting the selection text. One is via the internal events system, and in that case the problem you're having shouldn't occur. On some programs (gvim), pastie tries to grab the selection text every second.
"What program are you copying text from? " --> whatever the program (firefox, gedit etc...) "How fast are you selecting the text? " --> normally. Just select the text put it in the historic, not only the middle click.
LGDN
I see. Regarding the second, well, that's kinda the idea. The primary clipboard in linux (X) is simply the selected text. Now, programs can signal the selection has been completed, but this isn't handled the same for all applications. Pastie has no other way to detect the selection is complete but to depend on the programs signals (and in the case of vim, check if the clipboard changed every second - it simply doesn't signal the selection change at all after the first time). I have just checked, and it seems firefox works fine, but gedit doesn't. It seems to signal the selection is complete every some x ms.
I understand there are two different copy text in X: text selection every ms and middle click on a selected text. This is about this last functionnality it could be interesting to add to pastie, because it is faster to copy/paste text with a mouse middle click. Could you only retain middle click selection in pastie historic?
LGDN.
Hm... As far as I know, middle click is usually set to paste the primary selection in X systems, not to copy. So if you select some text, and then click the middle button in the mouse, the selection will get pasted. If this behavior is different in some app you use, please tell me; it might be that there's some special condition pastie needs to be aware of (the app can be setting the clipboard contents on middle button click without setting the needed timestamp-this is essentialy vim's problem). I can't make pastie override the normal behavior; that's something the source apps must deal with.
in gnome terminal, firefox or google chrome and others apps, I could select a text, then mouse middle click on it to copy it. Another mouse middle click will paste the text, whatever the apps.
LGDN
I've reimplemented the primary selection checking. The problems with repeated entries should be fixed now.
The new code is integrated into the testing
branch. The primary
branch is now deleted.
Could you tell me how obtain the testing branch? Thanks.
You can obtain a tarball from http://github.com/fmoralesc/pastie/tarball/testing
You might need to set manually the initial settings for GConf, though:
gconftool-2 --type bool --set /apps/pastie/prefs/use_primary true
gconftool-2 --type bool --set /apps/pastie/prefs/synch_primary true
I've released the code in 0.6.7 through the PPA. Will keep this open in case there's problems.
I just installed the ppa version, when I click on "use primary selection", I have an error segmentation. I reboot, same thing...
when I launch pastie from a terminal:
$pastie
\ (pastie:4796): WARNING **: Binding '
\ (pastie:4796): WARNING **: Binding '
Erreur de segmentation
If I could help you for debug, let me know how.
LGDN
Hm... this is interesting. It seems the binding schemas are misformatted (my bad). Where it says "Binding 'C' failed!", it should say "Binding '
This is what I have in gconf-editor:
http://img830.imageshack.us/img830/5893/tmpdpw8l.png
Is it correct ?
Yes, it is. (I was mistaken, anyway, it seems that github removed anything between < and >, so it seemed that the keys weren't set.)
the error segmentation only happened when I clik on the "use primary selection" option.
I see. I'll try to reproduce the bug.
Hello pastie boy, the primary selection works good and with the new version I have no more crash, you could close this issue. Thank you!
LGDN
Hello,
after testing your app I find it doesn't use the middle click copy from X, could you add this feature please. In parcellite you could enable/disablead this functionnality in the configuration.
Regards.
LGDN.