|
|
Home » U++ TheIDE » U++ TheIDE: Installation, Compiling and Running of theide » Strange behavior of clipboard in TheIde 609-dev1 on Linux
|
|
|
|
|
|
|
Re: Strange behavior of clipboard in TheIde 609-dev1 on Linux [message #5495 is a reply to message #5348] |
Wed, 27 September 2006 13:31 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
Today I have downloaded the 609-dev3, I compiled theIde and the clipboard problem persist.
Well, the problem is:
1) If I make Copy in a U++ App, the copied text does not paste in another application (for example gedit).
2) The same it happens the other way around. A text copied in gedit does not paste in a U++ app.
3) Nevertheless the text copied in U++app if one paste in that same app.
4) If I run a U++app and I don't do copy, then if I do Paste... Yes! app gets the Clipboard contents
I take all the morning watching how to solve this. I have watched in the source code of the GTK to see if it clarified my ideas. Also I have sailed by the QClipboard class of the QT and believe that I have sunk still more.
When I have downloaded the source of XFree86 to see some example, then my head explotes.
Nevertheless I have removed something in clear. This reference has clarified enough to the subject http://standards.freedesktop.org/clipboards-spec/clipboards- latest.txt
Hey, I consider I am a good C++ programmer but this exceeds my capacity, so I have resorted to the true-very-old method of the test-error.
At end I believe to have found the one solution quite simple, although the reasoning to arrive at her is intuitive or rather magician.
In the CtrlCore/X11lip.cpp file comment line 25.
void Ctrl::Xclipboard::Write(int fmt, const String& _data)
{
LLOG("SetSelectionOwner " << XAtomName(fmt));
data.GetAdd(fmt) = _data;
// if(XGetSelectionOwner(Xdisplay, XAtom("CLIPBOARD") != win)) <--this line out
XSetSelectionOwner(Xdisplay, XAtom("CLIPBOARD"), win, CurrentTime);
}
When doing this "I believe" that what happens is that updates (somehow) who made Copy for the last time in the system.
Also comment lines 65 and 66....
String Ctrl::Xclipboard::Read(int fmt)
{
// if(data.GetCount())
// return data.Get(fmt, Null);
XConvertSelection(Xdisplay, XAtom("CLIPBOARD"), fmt, XAtom("CLIPDATA"), win, CurrentTime);
XFlush(Xdisplay);
XEvent event;
When doing this "I believe" that what happens is that makes the request standard to see who has the last copy in clipboard. Of this form its own internal buffer is only used in the Request function although is she herself that made Copy the last time.
And now it seems that everything works.
Nico
|
|
|
|
|
|
Re: Strange behavior of clipboard in TheIde 609-dev1 on Linux [message #5500 is a reply to message #5499] |
Wed, 27 September 2006 14:26 |
nicomesas
Messages: 104 Registered: September 2006 Location: Barcelona, Spain
|
Experienced Member |
|
|
luzr wrote on Wed, 27 September 2006 14:08 |
nicomesas wrote on Wed, 27 September 2006 07:57 | No problem when I pasting to-from the same app.
|
Yes, it was just optimization. It is a little but inelegant if all these data are about to go through X11 server back to the same application IMHO. X11 is quite slow pumping them, it could have visible impact.
|
You are right, would be better to leave it as it were, although not very elegant
Now, I am using logs and already I have understand how the x11 clipboard works. He is almost "esoteric"!
It seems to me that line 140 is executed correctly!?. I will test more this evening, now I am going away to eat!
Nico
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Apr 18 13:59:51 CEST 2024
Total time taken to generate the page: 0.03295 seconds
|
|
|