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 652609 - clipboard: fix incremental sending from the clipboard manager
clipboard: fix incremental sending from the clipboard manager
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
: 577291 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-14 23:23 UTC by Cosimo Cecchi
Modified: 2011-09-17 03:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
clipboard: fix incremental sending from the clipboard manager (2.23 KB, patch)
2011-06-14 23:23 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2011-06-14 23:23:48 UTC
Right now, if the data in the clipboard is bigger than the allowed X selection size, it's never sent back to the requesting window. Attached patch fixes it.
Comment 1 Cosimo Cecchi 2011-06-14 23:23:49 UTC
Created attachment 189950 [details] [review]
clipboard: fix incremental sending from the clipboard manager

When the data to send from the clipboard is bigger than the maximum
allowed X selection size, we set the property value to XA_INCR, to
signal that the data should be sent in incremental chunks.
Unfortunately this never worked, because the manager didn't listen to
the property changes on the requestor window, so it didn't know when to
start sending data.
Comment 2 Matthias Clasen 2011-06-14 23:26:08 UTC
Review of attachment 189950 [details] [review]:

::: plugins/clipboard/gsd-clipboard-manager.c
@@ +395,3 @@
+                                            False,
+                                            PropertyChangeMask,
+                                            NULL);

A little worrisome that you stuff rdata->requestor into this cb, when rdata gets freed 3 lines down.
But maybe thats alright ?
Comment 3 Cosimo Cecchi 2011-06-14 23:32:33 UTC
(In reply to comment #2)

> A little worrisome that you stuff rdata->requestor into this cb, when rdata
> gets freed 3 lines down.
> But maybe thats alright ?

All the cb does, when passed False, is 

display = gdk_display_get_default ();
gdkwin = gdk_x11_window_lookup_for_display (display, window);

if (gdkwin == NULL)
  return;

gdk_window_remove_filter (gdkwin,
                         (GdkFilterFunc)clipboard_manager_event_filter,
                         manager);
g_object_unref (gdkwin);



So I believe it's fine (the refcount on gdkwin has been increased before, when adding the filter); there's no direct access to rdata or rdata->window after the cb has run.
Comment 4 Matthias Clasen 2011-06-14 23:40:04 UTC
yeah, seems fine then.
Comment 5 Bastien Nocera 2011-06-15 10:11:25 UTC
I don't have the foggiest about this. If Matthias is happy with it, I'm happy with it. Owen is the last person to have reviewed the clipboard code, so he might be able to help you out there.
Comment 6 Matthias Clasen 2011-06-20 12:15:17 UTC
Review of attachment 189950 [details] [review]:

I'm fine with it.
Comment 7 Cosimo Cecchi 2011-06-20 13:26:03 UTC
Ok, thanks. Pushed to master.

Attachment 189950 [details] pushed as f6c9e9d - clipboard: fix incremental sending from the clipboard manager
Comment 8 Cosimo Cecchi 2011-09-17 03:37:54 UTC
*** Bug 577291 has been marked as a duplicate of this bug. ***