| Summary: | Clipboard data is lost on exit (Should implement the freedesktop.org specification for clipboard management) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Sarah <sarah.e.strong> | ||||||||
| Component: | SWT | Assignee: | Arun Thondapu <arunkumar.thondapu> | ||||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||||
| Severity: | critical | ||||||||||
| Priority: | P3 | CC: | arunkumar.thondapu, dev, gheorghe, lshanmug, pwebster, remy.suen, sarah.e.strong, Silenio_Quarti | ||||||||
| Version: | 3.5.2 | Flags: | Silenio_Quarti:
review+
gheorghe: review+ |
||||||||
| Target Milestone: | 3.7 RC1 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Sarah
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! |