After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 160343 - win32 clipboard does not work with cells
win32 clipboard does not work with cells
Status: VERIFIED INCOMPLETE
Product: Gnumeric
Classification: Applications
Component: General
git master
Other Windows
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 160223 (view as bug list)
Depends on: 163702
Blocks:
 
 
Reported: 2004-12-03 14:33 UTC by Colin JN Breame
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (15.50 KB, application/octet-stream)
2004-12-30 10:36 UTC, Ivan Wong
  Details
proposed patch for gdk-win32 (1.41 KB, patch)
2004-12-30 10:47 UTC, Ivan Wong
none Details | Review
test binary of libgdk-win32 (223.63 KB, application/x-bzip)
2004-12-30 10:51 UTC, Ivan Wong
  Details
revised (2.72 KB, patch)
2004-12-30 15:47 UTC, Ivan Wong
none Details | Review
libgdk-win32-2.0-0.dll.bz2 (223.69 KB, application/x-bzip)
2004-12-30 15:50 UTC, Ivan Wong
  Details

Description Colin JN Breame 2004-12-03 14:33:37 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.
Comment 1 Morten Welinder 2004-12-04 22:04:44 UTC
*** Bug 160223 has been marked as a duplicate of this bug. ***
Comment 2 Toth, Botond 2004-12-06 19:29:17 UTC
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.
Comment 3 Morten Welinder 2004-12-10 02:55:39 UTC
jody: this might perhaps be the same issue as with KDE a couple of years ago
where some clipboard application kept stealing the selection.
Comment 4 Jody Goldberg 2004-12-10 18:00:56 UTC
morten : quite likely.  unlike klipper I doubt we can request that it be turned
off we may have to just disable it.
Comment 5 Dominic Lachowicz 2004-12-16 15:05:02 UTC
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.
Comment 6 Torsten Hildebrandt 2004-12-20 13:34:44 UTC
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.
Comment 7 Torsten Hildebrandt 2004-12-20 23:06:00 UTC
btw, this bug should get a higher priority as at least in my opinion it is a
show-stopper.
Comment 8 Christof Schatz 2004-12-22 16:26:41 UTC
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

Comment 9 Morten Welinder 2004-12-29 22:00:40 UTC
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.
Comment 10 Ivan Wong 2004-12-30 10:36:34 UTC
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.
Comment 11 Ivan Wong 2004-12-30 10:47:30 UTC
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.
Comment 12 Ivan Wong 2004-12-30 10:51:35 UTC
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.
Comment 13 j.gnome 2004-12-30 11:26:20 UTC
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.
Comment 14 Ivan Wong 2004-12-30 11:54:12 UTC
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
Comment 15 j.gnome 2004-12-30 12:06:38 UTC
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.
Comment 16 Ivan Wong 2004-12-30 15:47:19 UTC
Created attachment 35304 [details] [review]
revised

Added _gdk_selection_filter_clear_event() that has role similar to that of
gdkselection-x11.c
Comment 17 Ivan Wong 2004-12-30 15:50:05 UTC
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
Comment 18 j.gnome 2004-12-30 16:31:46 UTC
Thanks, now it seems to work. I played with it a bit, and couldn't find any
obvious bugs. Much much better.
Comment 19 Morten Welinder 2004-12-30 16:38:56 UTC
Time to open a gtk+ bug for this?
Comment 20 Dominic Lachowicz 2005-01-03 21:20:56 UTC
agreed
Comment 21 Jody Goldberg 2005-01-11 04:17:04 UTC
Ivan do we have a gtk bug number to block on for this ? 
Comment 22 Ivan Wong 2005-01-11 06:58:17 UTC
Will do it ASAP
Comment 23 Morten Welinder 2005-02-25 22:30:23 UTC
Ivan, has this been fixed?
Comment 24 Ivan Wong 2005-02-26 05:42:43 UTC
Certainly. Should close it.
Comment 25 Morten Welinder 2005-02-26 13:29:58 UTC
Fixed.