Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
nicomesas is currently offline  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. Confused

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. Razz

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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Install U++ in Ubuntu-6.06.1 Desktop 64bits
Next Topic: "Package organizer" and other dialogs are size incorrect in linux
Goto Forum:
  


Current Time: Thu Apr 18 07:01:22 CEST 2024

Total time taken to generate the page: 0.01383 seconds