|
kakaroto
|
 |
« Reply #6 on: January 21, 2007, 09:09:52 pm » |
|
hello, this issue is with tcl/tk. there are two clipboard, there is a 'system clipboard' and an 'application clipboard'. amsn has no access to the system clipboard, it actually is Xorg/Xfree that takes care of that and it doesn't allow applications to access it (or at least, tk applications can't). So how this works is really weird and I spent a lot of time trying to figure that out. When you select a text in any application, X copies the text, if you middle click in amsn AND that other text you copied is STILL selected (the selection didn't disappear when you clicked somewhere else), then that text will be pasted into amsn (by X, amsn does nothing). If the text has been unselected because you clicked somewhere, it *should* still be in the clipboard, but it isn't so when you middle click, amsn realizes that the system clipboard is empty, so nothing will be pasted, so it takes over and it pastes the content of the 'application clipboard'. To easily understand this, type some text in a chat window with some smileys, then select the text, middle click and you'll see the text pasted but without the smileys, that's because X doesn't see the smiley's text and only copies/pastes the text (from/to the system clipboard), now single-click somewhere in the chatwindow to unselect the text that was selected, and now middle click again in the chat window, you'll see that the text is pasted with the smileys this time. This is because when you selected, amsn took care of transforming the smileys into text but could only put that information in the application clipboard, so when you middle clicked to paste, amsn checked the system clipboard, found out it was empty, so it manually did a paste from the application clipboard which contained the text with the smileys. Ctrl-V is application driven, it's not a middle click so it's not being taken care of by the system, so I think a ctrl-V will paste the application clipboard, not the system clipboard (although I think when a selection is done, we 'try' to copy the content of the system clipboard to the application clipboard, but I'm not sure if it's true or if it always works).
so in other words, what vivia told you to do is to make sure the text is still selected when you do your paste, and I'm telling you to make sure you do it with the middle click.
I'm curious though about you saying "it works with other applications', I'd like to know if those other applications let the system do the pasting or if they override the pasting themselves, or whatever.. could you tell us which other tk application you tried this with ? Also, could you try to paste in another window, like maybe the change nickname, or notes or the add/edit custom state windows, I'd like to see whether it is a specific issue with the handling of pasting in the chat window or not (because of the smilies thing), if it works correctly in other windows, maybe I can find a way to fix this issue with system/application clipboard once and for all.
I hope this post was helpful to you.
Thanks
|