GNOME Bugzilla – Bug 160343
win32 clipboard does not work with cells
Last modified: 2009-08-15 18:40:50 UTC
1) Select multiple cells 2) select either cut or copy 3) then paste Nothing happens. It should paste the cells that were cut/copied.
*** Bug 160223 has been marked as a duplicate of this bug. ***
The same to me, however if I click the text field above, I can paste there the contents of previously copied cells. Of course it leaves me with on cell containing the contents of more cells (with separators). After copiing cells I could paste the contents in text editor. Experienced that both in 1.3.92-rc1 and in 1.3.93-rc1 under win32.
jody: this might perhaps be the same issue as with KDE a couple of years ago where some clipboard application kept stealing the selection.
morten : quite likely. unlike klipper I doubt we can request that it be turned off we may have to just disable it.
i also see this bug on win32, and i'm not aware of any clipboard manager running on my system. i even disabled cygwin's X11 server while testing, just in case its clipboard-intercepting code was causing this bug. for the record, cut+paste works fine here with other GTK+ apps, such as XChat, Gaim, Gimp, Dia, Inkscape, and Workrave.
I just installed 1.4.1-rc4 on WinXP (SP2, german) and copy/paste isn't working. Actually something is copied to the clipboard and you can paste it e.g. in Notepad, but there is no indication of the copied region in gnumeric and I can't paste anything in Gnumeric.
btw, this bug should get a higher priority as at least in my opinion it is a show-stopper.
As I must confirm for Win2000SP4: Nothing happens. After the first enthusiastic view on the features the crash against the "not usable" wall is even harder. Merry Christmas
Obviously this is a show stopper; it's in fact one of two reasons why we marked this build as not quite ready for production usage. We'll get to it, post-vacation time. I'll fiddle with the bugzilla priority, but we aren't big enough to really make use of that field so nothing basically will change.
Created attachment 35295 [details] test program Perhaps it's problem of gdk-win32. e.g. with this segment of code: static void x_clipboard_get_cb(GtkClipboard * gclipboard, GtkSelectionData * selection_data, guint info, GObject * obj) { printf("x_clipboard_get_cb\n"); gtk_selection_data_set_text(selection_data, "test", -1); } static gint x_clipboard_clear_cb(GtkClipboard * clipboard, gpointer data) { printf("x_clipboard_clear_cb\n"); return TRUE; } void on_button1_clicked(GtkButton * button, gpointer user_data) { GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(button)); static GtkTargetEntry const targets[] = { {(char *) "text/html", 0, 0}, {(char *) "UTF8_STRING", 0, 0}, {(char *) "COMPOUND_TEXT", 0, 0}, {(char *) "STRING", 0, 0}, }; gtk_clipboard_set_with_owner(gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD), targets, G_N_ELEMENTS(targets), (GtkClipboardGetFunc) x_clipboard_get_cb, (GtkClipboardClearFunc) x_clipboard_clear_cb, G_OBJECT(button)); printf("on_button1_clicked\n"); } if I click button1, I will immediately see: on_button1_clicked x_clipboard_get_cb x_clipboard_clear_cb This behaviour is explained by the comment block inside gdk_selection_send_notify_for_display() of gdk/win32/gdkselection-win32.c The binary of the above test program is attached.
Created attachment 35296 [details] [review] proposed patch for gdk-win32 Removing the artifical GDK_SELECTION_CLEAR event seems to sovle the copy problem of Gnumeric. And after that I cannot replicate the problem discribed by the comment block of gdk_selection_send_notify_for_display() of gdk/win32/gdk-selection-win32.c, i.e. "if a gtkeditable does a copy to CLIPBOARD several times only the first one actually gets copied to the Windows clipboard". Furthermore, I try to handle WM_DESTROYCLIPBOARD so that when the ownership of the Windows clipboard changes, a corresponding GDK_SELECTION_CLEAR emits.
Created attachment 35297 [details] test binary of libgdk-win32 Attached please find the temp build with the proposed patch applied for testing. Replace the original libgdk-win32-2.0-0.dll of gnumeric-1.4.1-rc4 with this one and copying cells will work fine.
I replaced the original libgdk-win32 dll with attachment 35297 [details]. 1.4.1-rc4 now says: "The application or DLL C:\Gnumeric\bin\libgdk-win32-2.0-0.dll is not a valid Windows image. Please check this against your installation diskette." Also, the size is 224 KB and the old one was 448 KB.
It's bzip2ed. Please save it as "libgdk-win32-2.0-0.dll.bz2" and bunzip2 it. Or you can get it directly from here: http://www.ivanwong.info/gnumeric/libgdk-win32-2.0-0.dll
Sigh. Thanks. It does work better after bunzipping. :) However: 1. Select A1, press ctrl-c 2. Select A2, press ctrl-v (works ok) 3. Press esc to get rid of the blinking After pressing esc, copying and pasting doesn't work anymore.
Created attachment 35304 [details] [review] revised Added _gdk_selection_filter_clear_event() that has role similar to that of gdkselection-x11.c
Created attachment 35305 [details] libgdk-win32-2.0-0.dll.bz2 Or get it from here: http://www.ivanwong.info/gnumeric/libgdk-win32-2.0-0.dll
Thanks, now it seems to work. I played with it a bit, and couldn't find any obvious bugs. Much much better.
Time to open a gtk+ bug for this?
agreed
Ivan do we have a gtk bug number to block on for this ?
Will do it ASAP
Ivan, has this been fixed?
Certainly. Should close it.
Fixed.