Copy/Paste not working correctly, pastes old contents... What the

I’m using the nightly build and this has happened to me only once, but it’s very VERY odd. I copied something from inside the SDK onto another document still within the SDK. Then I went to do some Firefox browsing and I copied a snippet of code on a website and then I alt-tabbed back to the SDK and pasted, but to my surprise, it was still the old code from minutes ago that I got from inside the SDK. Then, I opened the Windows Notepad and pasted and to my even GREATER SURPRISE it was the new code taken from Firefox. I went back to the SDK and pasted again, but it was still the old code I copied a while back.

How can 2 programs not even have the same clipboard contents! I’ve been using computers since end of the 80’s and I’ve never EVER come accross this issue before. It’s pretty damn weird, isn’t it? If I paste in any program other than the SDK, the contents is good, but in the SDK, it’s stuck to an old clipboard contents I copied a while ago.

I closed the SDK program completely and reopened it and pasted and now the correct contents is pasted. But it’s amazing that there is obviously many clipboards used in parrallel in Windows, I didn’t know that!

Possible explanation: Clipboards can have different contents of different types of data. Sometimes apps don’t clear the rest of the clipboard when the stick something in and you have multiple types of data in the clipboard.

It’s therefore unclear to me which app is at fault in this case. Is it Firefox for not clearing the clipboard? Or is it the SDK for not checking for more basic types of clip board data? (Actually, I’m going to blame Firefox as I’ve had it severely screw up my clipboard on multiple occasions [to the point where I can’t even get screenshots into Photoshop anymore until shutting Firefox down]… and I’m still bitter.)

I’ve had that happen to me too. Maybe twice in all the times I’ve used the SDK so, it’s pretty rare.

Were you copying something from Firefox when that happened @madjack?

Possibly… But I don’t think so. I -think- it was with Notepad++. But as I said, it happened twice in like 3 years so it could’ve been with FF.

In case it’s relevant, my own clipboard symptoms were related to hyperdesktop.

I could take one screen shot and upload it to imgur without issue. After that, hyperdesktop on this machine would refuse to capture any more images. Strangely, if I did a print-scrn to capture the screen and tried to load it into photoshop then it came out as a pure black and white image (no gray, 1 bit color). I cursed out a lot of tools before I figured out that closing firefox would get me past the issue until I took another screen shot.

At some point in the last few months, a firefox upgrade fixed this issue. I can now happily use hyperdesktop again on this machine and draw all of my ugly red circles and arrows that I love to post here. :wink:

I’ve never seen the issue originally posted but I originally responded just to mention “how” it could happen. The clipboard is more complicated than one might think but without some kind of clipboard viewer utility it’s tough to say specifically what went wrong. I a long time ago I wrote a shared clipboard app that would allow multiple machines to share the same clipboard data over the network… so I have vague recollections about the multiple data types thing. Painful.

LOL… painful well from my point of view, I know my very very old Macintosh computer had an extension in the OS that allowed the clipboard to have up to 10 slots, which I could swap using a key combination on my keyboard prior to copy/pasting. It was SOMEWHAT useful, but here at the moment, I’m sitting at a very vanilla Windows 7 SP1 computer, absolutely no OS modification or special software, only the SDK, Firefox, Thunderbird, Skype and my Wamp server open. Basically, the same software I use everyday that never caused this issue. Well… anyhow, thanks all for sharing the point of views on this. Closing and reopening the SDK really “fixed” the issue so… I guess it’s true that you can’t really blame the SDK, it’s just a combination of software open at the same time that may cause this on very rare occasions.

@.Ben. said: LOL... *painful* well from my point of view, I know my very very old Macintosh computer had an extension in the OS that allowed the clipboard to have up to 10 slots, which I could swap using a key combination on my keyboard prior to copy/pasting. It was SOMEWHAT useful, but here at the moment, I'm sitting at a very vanilla Windows 7 SP1 computer, absolutely no OS modification or special software, only the SDK, Firefox, Thunderbird, Skype and my Wamp server open. Basically, the same software I use everyday that never caused this issue. Well... anyhow, thanks all for sharing the point of views on this. Closing and reopening the SDK really "fixed" the issue so... I guess it's true that you can't really blame the SDK, it's just a combination of software open at the same time that may cause this on very rare occasions.

The “multiple content” thing is why you can cut and paste fancy text from word but also still paste it without formatting into things like notepad (raw text). Each of the apps subscribes a different type of data. Generally when something is posted to the clipboard then the other types are cleared. Sometimes this is not the case. (For example, cut-pasting files between folders also uses the clipboard but generally won’t wipe out text content.)

And compared to what there is to know about the modern clipboard, I basically know next to nothing. Complicated mess.

Generally when something is posted to the clipboard then the other types are cleared. Sometimes this is not the case. (For example, cut-pasting files between folders also uses the clipboard but generally won't wipe out text content.)

Well, on Windows at least, it does not work like this at all. Copying a folder does clear raw text I copied before from Notepad. That’s why I find it strange you can have many clipboard types mixed together. I remember programming in RealBasic 15 years ago, the clipboard contents had a “type” but there was only 1 slot in the clipboard and when you pasted a type that wouldn’t be compatible with the application, then it was up to the programmer to refuse the data and simply do nothing. But I remember having clipboard types.

As for the example you gave with fancy text from Word or a HTML page, well, I thought it was up to the application in which you paste to manipulate the data but I may be wrong with this. For exemple, when you paste HTML in Thunderbird, the email gets formated accordingly, while if you pasted it in Notepad, it would only retain ASCII text so I thought the Notepad would simply retain the text stripping out the HTML code. There are very simple regex functions that do that and many programming languages already have functions you can pass the raw data in and it returns it stripped down, like in PHP we use strip_tags() which only keeps ASCII text and strips all the HTML tags out.

Since this thread is related to clipboard usage with the IDE… anyone else have issues copying multiple xml files? These get corrupted often for me. Tested on 3 different machines and 5 out of 10 tries with copying more than a single XML file will leave one corrupted.

The other I see always is the inability to copy j3md files… at all. I have to recreate them and copy the content from the original into the new.

Any of these happen to anyone else? Or am I just… um… special?

Well, what you say could be true. I just know that if you write an app to query the clipboard, you can request the data in multiple formats. http://docs.oracle.com/javase/6/docs/api/java/awt/datatransfer/Clipboard.html#getData(java.awt.datatransfer.DataFlavor)

…and the number and type of formats will be different depending on the application that posted them.

@t0neg0d said: Since this thread is related to clipboard usage with the IDE... anyone else have issues copying multiple xml files? These get corrupted often for me. Tested on 3 different machines and 5 out of 10 tries with copying more than a single XML file will leave one corrupted.

The other I see always is the inability to copy j3md files… at all. I have to recreate them and copy the content from the original into the new.

Any of these happen to anyone else? Or am I just… um… special?

You mean copying inside the SDK itself or in the file system? For some reason, lore or otherwise, I don’t trust the SDK to copy files. I barely trust it to move my classes from one package to another but the pain of the alternative is greater than the risk. So I may not have hit this issue, personally.

1 Like

https://netbeans.org/bugzilla/show_bug.cgi?id=88161

Hi @t0neg0d, oh yeah definitely. .j3md files copy/pasting is HORRIBLE in the SDK. I don’t know what the problem is with these files but the SDK doesn’t behave well at all with them. What makes me so mad about it is when I try to drag and drop or copy/paste a whole subfolders hierarchy and when it contains a material definition file, it will stop at that folder node and not output any error, so I have to find it out by myself and manually continue where it left off.

When I began a few months ago with JME3, it was so frustrating! After many failures to duplicate or copy/paste material definition files, I ended up making it a habit to create an empty file and manually copy/pasting the contents in that file. There is another issue with the material files, it’s that 1 time of out say 2 if I change the file and save it, then when I close it, it asks me AGAIN if I want to save this file and even if I say yes (or no) it won’t save it and just discard the changes. Also I noticed that it’s the only file type that the comptuer will hang for 2 seconds when I try to save it. My computer is very fast and new and doesn’t freeze ever except for when I try to save a material file. I think it does like link checking and (maybe?) tries to COMPILE something when these file types are saved, I just don’t know, but I know for sure it’s a pain in the F**** butt :stuck_out_tongue: Then I reopen the file, copy/paste the contents AGAIN and save it and then usually it works that time.

@jmaasing said: https://netbeans.org/bugzilla/show_bug.cgi?id=88161

Holy sh** dude, 7 and a half years ago and STILL not fixed? Well, it’s not the SDK fault, but it looks like it’s a very very old bug still roaming, god, somebody please fix this!!! Wow :smiley:

Well… this wouldn’t be top of my priority list… but will like it when it does get resolved.

I tend to work around known issues and hope that people will be as kind to me when it’s my code (though, usually not >.< )

The j3md issue is relatively new (as apposed to years and years old. Probably started about 1-1.5 years ago tops. My machine was so shitty at the time, I just assumed it was the problem.

No, there’s definitely something wrong with mat def files saving/copying/moving/importing :wink:

@.Ben. said: Holy sh** dude, 7 and a half years ago and STILL not fixed? Well, it's not the SDK fault, but it looks like it's a very very old bug still roaming, god, somebody please fix this!!! Wow :D

Note: I saw this post in that thread:
https://netbeans.org/bugzilla/show_bug.cgi?id=88161#c57

…which is old but sounded vaguely familiar to what you described originally. If so then the next post from the same user had a work-around link that worked in his case. It also seemed like there was a system property at one time that would turn off the hack that causes the bug… but I don’t know if that was removed in later versions that were attempting to “fix” the issue.

The history is long and colorful.