Community
Participate
Working Groups
Build Identifier: M20100211-1343 When you quit Eclipse in X11-based systems, you lose any data that was on the clipboard. You can find more information about this bug and how to fix it at https://wiki.ubuntu.com/ClipboardPersistence. Note: I've marked it as critical because it does cause loss of user data. However, it only causes loss of data in the uncommon use case of copy -> do not save -> quit -> paste, so downgrading the severity might be appropriate. Reproducible: Always Steps to Reproduce: Pre-requisite: Machine running an X11-based window manager, without extended clipboard manager such as Klipper. Tested on Ubuntu Lucid. 1. Copy text in Eclipse. You can copy this text from IDE, help documentation, dialog boxes, or any other UI element. 2. Paste it to another window, this works as expected. 3. Quit Eclipse. 4. Try to paste, there is now nothing in the clipboard.
Arun, please investigate this bug.
Created attachment 195055 [details] Proposed patch Please review this patch. I have tested it using the 'ClipboardExample' as well as by launching Eclipse with the 'Eclipse Application' run configuration. Pasting of copied text works now even after Eclipse exits. Please let me know if this fix can get into 3.7 RC1. Thanks!
Yes, we should do this for RC1, but first please address these issues: - Patch is missing the changes in OS.java. Please include them. - It is better to include the auto generated changes as well (in os.c, os_stats.c and os_stats.h). It is easier for someone to review. - The functions gtk_clipboard_set_can_store() and gtk_clipboard_store() were only added in GTK 2.6. Need to add a version check. Something like "OS.GTK_VERSION >= OS.VERSION(2, 6, 0)". You should still call gtk_clipboard_clear() for old versions.
Oops sorry I missed those files in the patch by mistake. I'll upload a revised patch which includes the version check too. (In reply to comment #3) > Yes, we should do this for RC1, but first please address these issues: > > - Patch is missing the changes in OS.java. Please include them. > > - It is better to include the auto generated changes as well (in os.c, > os_stats.c and os_stats.h). It is easier for someone to review. > > - The functions gtk_clipboard_set_can_store() and gtk_clipboard_store() were > only added in GTK 2.6. Need to add a version check. Something like > "OS.GTK_VERSION >= OS.VERSION(2, 6, 0)". You should still call > gtk_clipboard_clear() for old versions.
Created attachment 195182 [details] Revised patch This is the revised patch which contains all the relevant changes. Please review the same and suggest if I have missed anything else. Thanks!
(In reply to comment #5) > Created attachment 195182 [details] > Revised patch > > This is the revised patch which contains all the relevant changes. > Please review the same and suggest if I have missed anything else. gtk_clipboard_set_can_store is also a GTK 2.6 method (see Silenio's comment 3). http://developer.gnome.org/gtk/2.6/gtk-Clipboards.html#gtk-clipboard-set-can-store
Arun, - Please add the version check around gtk_clipboard_set_can_store() as well. - Try to keep the same formatting. An if/else statement should always have the curly brackets block: if (OS.GTK_VERSION >= OS.VERSION(2, 6, 0)) { OS.gtk_clipboard_store(Clipboard.GTKCLIPBOARD); } else { OS.gtk_clipboard_clear(Clipboard.GTKCLIPBOARD); } An if statement by itself may not have the curly bracket block, but the block should be in the same line. For example: if (clipboardOwner != 0) OS.gtk_widget_destroy (clipboardOwner);
Created attachment 195273 [details] final patch Here is the patch my last requests. I will release the changes so that we can get it in tomorrow's I-build.
Fixed > 20110510 Thanks Arun!