1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
|
/* $Id$ */
/*-
* Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <thunar/thunar-application.h>
#include <thunar/thunar-clipboard-manager.h>
#include <thunar/thunar-dialogs.h>
enum
{
PROP_0,
PROP_CAN_PASTE,
};
enum
{
CHANGED,
LAST_SIGNAL,
};
enum
{
TARGET_GNOME_COPIED_FILES,
TARGET_UTF8_STRING,
};
static void thunar_clipboard_manager_class_init (ThunarClipboardManagerClass *klass);
static void thunar_clipboard_manager_init (ThunarClipboardManager *manager);
static void thunar_clipboard_manager_finalize (GObject *object);
static void thunar_clipboard_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void thunar_clipboard_manager_file_destroyed (ThunarFile *file,
ThunarClipboardManager *manager);
static void thunar_clipboard_manager_owner_changed (GtkClipboard *clipboard,
GdkEventOwnerChange *event,
ThunarClipboardManager *manager);
static void thunar_clipboard_manager_contents_received (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
gpointer user_data);
static void thunar_clipboard_manager_targets_received (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
gpointer user_data);
static void thunar_clipboard_manager_get_callback (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
gpointer user_data);
static void thunar_clipboard_manager_clear_callback (GtkClipboard *clipboard,
gpointer user_data);
static void thunar_clipboard_manager_transfer_files (ThunarClipboardManager *manager,
gboolean copy,
GList *files);
struct _ThunarClipboardManagerClass
{
GObjectClass __parent__;
void (*changed) (ThunarClipboardManager *manager);
};
struct _ThunarClipboardManager
{
GObject __parent__;
GtkClipboard *clipboard;
gboolean can_paste;
GdkAtom x_special_gnome_copied_files;
gboolean files_cutted;
GList *files;
};
typedef struct
{
ThunarClipboardManager *manager;
ThunarVfsPath *target_path;
GtkWidget *widget;
GClosure *new_files_closure;
} ThunarClipboardPasteRequest;
static const GtkTargetEntry clipboard_targets[] =
{
{ "x-special/gnome-copied-files", 0, TARGET_GNOME_COPIED_FILES },
{ "UTF8_STRING", 0, TARGET_UTF8_STRING }
};
static GObjectClass *thunar_clipboard_manager_parent_class;
static GQuark thunar_clipboard_manager_quark = 0;
static guint manager_signals[LAST_SIGNAL];
GType
thunar_clipboard_manager_get_type (void)
{
static GType type = G_TYPE_INVALID;
if (G_UNLIKELY (type == G_TYPE_INVALID))
{
static const GTypeInfo info =
{
sizeof (ThunarClipboardManagerClass),
NULL,
NULL,
(GClassInitFunc) thunar_clipboard_manager_class_init,
NULL,
NULL,
sizeof (ThunarClipboardManager),
0,
(GInstanceInitFunc) thunar_clipboard_manager_init,
NULL,
};
type = g_type_register_static (G_TYPE_OBJECT, I_("ThunarClipboardManager"), &info, 0);
}
return type;
}
static void
thunar_clipboard_manager_class_init (ThunarClipboardManagerClass *klass)
{
GObjectClass *gobject_class;
/* determine the parent type class */
thunar_clipboard_manager_parent_class = g_type_class_peek_parent (klass);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_clipboard_manager_finalize;
gobject_class->get_property = thunar_clipboard_manager_get_property;
/**
* ThunarClipboardManager:can-paste:
*
* This property tells whether the current clipboard content of
* this #ThunarClipboardManager can be pasted into a folder
* displayed by a #ThunarView.
**/
g_object_class_install_property (gobject_class,
PROP_CAN_PASTE,
g_param_spec_boolean ("can-paste",
_("Can paste"),
_("Whether the clipboard content can be pasted"),
FALSE,
EXO_PARAM_READABLE));
/**
* ThunarClipboardManager::changed:
* @manager : a #ThunarClipboardManager.
*
* This signal is emitted whenever the contents of the
* clipboard associated with @manager changes.
**/
manager_signals[CHANGED] =
g_signal_new (I_("changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (ThunarClipboardManagerClass, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
static void
thunar_clipboard_manager_init (ThunarClipboardManager *manager)
{
manager->x_special_gnome_copied_files = gdk_atom_intern ("x-special/gnome-copied-files", FALSE);
}
static void
thunar_clipboard_manager_finalize (GObject *object)
{
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (object);
GList *lp;
/* release any pending files */
for (lp = manager->files; lp != NULL; lp = lp->next)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (lp->data), thunar_clipboard_manager_file_destroyed, manager);
g_object_unref (G_OBJECT (lp->data));
}
g_list_free (manager->files);
/* disconnect from the clipboard */
g_signal_handlers_disconnect_by_func (G_OBJECT (manager->clipboard), thunar_clipboard_manager_owner_changed, manager);
g_object_set_qdata (G_OBJECT (manager->clipboard), thunar_clipboard_manager_quark, NULL);
g_object_unref (G_OBJECT (manager->clipboard));
(*G_OBJECT_CLASS (thunar_clipboard_manager_parent_class)->finalize) (object);
}
static void
thunar_clipboard_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (object);
switch (prop_id)
{
case PROP_CAN_PASTE:
g_value_set_boolean (value, thunar_clipboard_manager_get_can_paste (manager));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
thunar_clipboard_manager_file_destroyed (ThunarFile *file,
ThunarClipboardManager *manager)
{
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (g_list_find (manager->files, file) != NULL);
/* remove the file from our list */
manager->files = g_list_remove (manager->files, file);
/* disconnect from the file */
g_signal_handlers_disconnect_by_func (G_OBJECT (file), thunar_clipboard_manager_file_destroyed, manager);
g_object_unref (G_OBJECT (file));
}
static void
thunar_clipboard_manager_owner_changed (GtkClipboard *clipboard,
GdkEventOwnerChange *event,
ThunarClipboardManager *manager)
{
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (manager->clipboard == clipboard);
/* need to take a reference on the manager, because the clipboards
* "targets received callback" mechanism is not cancellable.
*/
g_object_ref (G_OBJECT (manager));
/* request the list of supported targets from the new owner */
gtk_clipboard_request_contents (clipboard, gdk_atom_intern ("TARGETS", FALSE),
thunar_clipboard_manager_targets_received, manager);
}
static void
thunar_clipboard_manager_contents_received (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
gpointer user_data)
{
ThunarClipboardPasteRequest *request = user_data;
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (request->manager);
ThunarApplication *application;
gboolean path_copy = TRUE;
GList *path_list = NULL;
gchar *data;
/* check whether the retrieval worked */
if (G_LIKELY (selection_data->length > 0))
{
/* be sure the selection data is zero-terminated */
data = (gchar *) selection_data->data;
data[selection_data->length] = '\0';
/* check whether to copy or move */
if (g_ascii_strncasecmp (data, "copy\n", 5) == 0)
{
path_copy = TRUE;
data += 5;
}
else if (g_ascii_strncasecmp (data, "cut\n", 4) == 0)
{
path_copy = FALSE;
data += 4;
}
/* determine the path list stored with the selection */
path_list = thunar_vfs_path_list_from_string (data, NULL);
}
/* perform the action if possible */
if (G_LIKELY (path_list != NULL))
{
application = thunar_application_get ();
if (G_LIKELY (path_copy))
thunar_application_copy_into (application, request->widget, path_list, request->target_path, request->new_files_closure);
else
thunar_application_move_into (application, request->widget, path_list, request->target_path, request->new_files_closure);
g_object_unref (G_OBJECT (application));
thunar_vfs_path_list_free (path_list);
/* clear the clipboard if it contained "cutted data"
* (gtk_clipboard_clear takes care of not clearing
* the selection if we don't own it)
*/
if (G_UNLIKELY (!path_copy))
gtk_clipboard_clear (manager->clipboard);
/* check the contents of the clipboard again
* if either the Xserver or our GTK+ version
* doesn't support the XFixes extension.
*/
#if GTK_CHECK_VERSION(2,6,0)
if (!gdk_display_supports_selection_notification (gtk_clipboard_get_display (manager->clipboard)))
#endif
{
thunar_clipboard_manager_owner_changed (manager->clipboard, NULL, manager);
}
}
else
{
/* tell the user that we cannot paste */
thunar_dialogs_show_error (request->widget, NULL, _("There is nothing on the clipboard to paste"));
}
/* free the request */
if (G_LIKELY (request->widget != NULL))
g_object_remove_weak_pointer (G_OBJECT (request->widget), (gpointer) &request->widget);
if (G_LIKELY (request->new_files_closure != NULL))
g_closure_unref (request->new_files_closure);
g_object_unref (G_OBJECT (request->manager));
thunar_vfs_path_unref (request->target_path);
g_free (request);
}
static void
thunar_clipboard_manager_targets_received (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
gpointer user_data)
{
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (user_data);
GdkAtom *targets;
gint n_targets;
gint n;
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (manager->clipboard == clipboard);
/* reset the "can-paste" state */
manager->can_paste = FALSE;
/* check the list of targets provided by the owner */
if (gtk_selection_data_get_targets (selection_data, &targets, &n_targets))
{
for (n = 0; n < n_targets; ++n)
if (targets[n] == manager->x_special_gnome_copied_files)
{
manager->can_paste = TRUE;
break;
}
g_free (targets);
}
/* notify listeners that we have a new clipboard state */
g_signal_emit (G_OBJECT (manager), manager_signals[CHANGED], 0);
g_object_notify (G_OBJECT (manager), "can-paste");
/* drop the reference taken for the callback */
g_object_unref (G_OBJECT (manager));
}
static void
thunar_clipboard_manager_get_callback (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint target_info,
gpointer user_data)
{
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (user_data);
GList *path_list = NULL;
GList *lp;
gchar *string_list;
gchar *data;
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (manager->clipboard == clipboard);
/* determine the path list from the file list */
for (lp = manager->files; lp != NULL; lp = lp->next)
path_list = g_list_append (path_list, thunar_file_get_path (lp->data));
/* determine the string representation of the path list */
string_list = thunar_vfs_path_list_to_string (path_list);
switch (target_info)
{
case TARGET_GNOME_COPIED_FILES:
data = g_strconcat (manager->files_cutted ? "cut\n" : "copy\n", string_list, NULL);
gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar *) data, strlen (data));
g_free (data);
break;
case TARGET_UTF8_STRING:
gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar *) string_list, strlen (string_list));
break;
default:
g_assert_not_reached ();
}
/* cleanup */
g_list_free (path_list);
g_free (string_list);
}
static void
thunar_clipboard_manager_clear_callback (GtkClipboard *clipboard,
gpointer user_data)
{
ThunarClipboardManager *manager = THUNAR_CLIPBOARD_MANAGER (user_data);
GList *lp;
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (manager->clipboard == clipboard);
/* release the pending files */
for (lp = manager->files; lp != NULL; lp = lp->next)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (lp->data), thunar_clipboard_manager_file_destroyed, manager);
g_object_unref (G_OBJECT (lp->data));
}
g_list_free (manager->files);
manager->files = NULL;
}
static void
thunar_clipboard_manager_transfer_files (ThunarClipboardManager *manager,
gboolean copy,
GList *files)
{
ThunarFile *file;
GList *lp;
/* release any pending files */
for (lp = manager->files; lp != NULL; lp = lp->next)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (lp->data), thunar_clipboard_manager_file_destroyed, manager);
g_object_unref (G_OBJECT (lp->data));
}
g_list_free (manager->files);
/* remember the transfer operation */
manager->files_cutted = !copy;
/* setup the new file list */
for (lp = files, manager->files = NULL; lp != NULL; lp = lp->next)
{
file = g_object_ref (G_OBJECT (lp->data));
manager->files = g_list_prepend (manager->files, file);
g_signal_connect (G_OBJECT (file), "destroy", G_CALLBACK (thunar_clipboard_manager_file_destroyed), manager);
}
/* acquire the CLIPBOARD ownership */
gtk_clipboard_set_with_owner (manager->clipboard, clipboard_targets,
G_N_ELEMENTS (clipboard_targets),
thunar_clipboard_manager_get_callback,
thunar_clipboard_manager_clear_callback,
G_OBJECT (manager));
/* Need to fake a "owner-change" event here if the Xserver doesn't support clipboard notification */
#if GTK_CHECK_VERSION(2,6,0)
if (!gdk_display_supports_selection_notification (gtk_clipboard_get_display (manager->clipboard)))
#endif
{
thunar_clipboard_manager_owner_changed (manager->clipboard, NULL, manager);
}
}
/**
* thunar_clipboard_manager_get_for_display:
* @display : a #GdkDisplay.
*
* Determines the #ThunarClipboardManager that is used to manage
* the clipboard on the given @display.
*
* The caller is responsible for freeing the returned object
* using g_object_unref() when it's no longer needed.
*
* Return value: the #ThunarClipboardManager for @display.
**/
ThunarClipboardManager*
thunar_clipboard_manager_get_for_display (GdkDisplay *display)
{
ThunarClipboardManager *manager;
GtkClipboard *clipboard;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
/* generate the quark on-demand */
if (G_UNLIKELY (thunar_clipboard_manager_quark == 0))
thunar_clipboard_manager_quark = g_quark_from_static_string ("thunar-clipboard-manager");
/* figure out the clipboard for the given display */
clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
/* check if a clipboard manager exists */
manager = g_object_get_qdata (G_OBJECT (clipboard), thunar_clipboard_manager_quark);
if (G_LIKELY (manager != NULL))
{
g_object_ref (G_OBJECT (manager));
return manager;
}
/* allocate a new manager */
manager = g_object_new (THUNAR_TYPE_CLIPBOARD_MANAGER, NULL);
manager->clipboard = g_object_ref (G_OBJECT (clipboard));
g_object_set_qdata (G_OBJECT (clipboard), thunar_clipboard_manager_quark, manager);
/* listen for the "owner-change" signal on the clipboard */
g_signal_connect (G_OBJECT (manager->clipboard), "owner-change",
G_CALLBACK (thunar_clipboard_manager_owner_changed), manager);
return manager;
}
/**
* thunar_clipboard_manager_get_can_paste:
* @manager : a #ThunarClipboardManager.
*
* Tells whether the contents of the clipboard represented
* by @manager can be pasted into a folder.
*
* Return value: %TRUE if the contents of the clipboard
* represented by @manager can be pasted
* into a folder.
**/
gboolean
thunar_clipboard_manager_get_can_paste (ThunarClipboardManager *manager)
{
g_return_val_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager), FALSE);
return manager->can_paste;
}
/**
* thunar_clipboard_manager_has_cutted_file:
* @manager : a #ThunarClipboardManager.
* @file : a #ThunarFile.
*
* Checks whether @file was cutted to the given @manager earlier.
*
* Return value: %TRUE if @file is on the cutted list of @manager.
**/
gboolean
thunar_clipboard_manager_has_cutted_file (ThunarClipboardManager *manager,
const ThunarFile *file)
{
g_return_val_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager), FALSE);
g_return_val_if_fail (THUNAR_IS_FILE (file), FALSE);
return (manager->files_cutted && g_list_find (manager->files, file) != NULL);
}
/**
* thunar_clipboard_manager_copy_files:
* @manager : a #ThunarClipboardManager.
* @files : a list of #ThunarFile<!---->s.
*
* Sets the clipboard represented by @manager to
* contain the @files and marks them to be copied
* when the user pastes from the clipboard.
**/
void
thunar_clipboard_manager_copy_files (ThunarClipboardManager *manager,
GList *files)
{
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
thunar_clipboard_manager_transfer_files (manager, TRUE, files);
}
/**
* thunar_clipboard_manager_cut_files:
* @manager : a #ThunarClipboardManager.
* @files : a list of #ThunarFile<!---->s.
*
* Sets the clipboard represented by @manager to
* contain the @files and marks them to be moved
* when the user pastes from the clipboard.
**/
void
thunar_clipboard_manager_cut_files (ThunarClipboardManager *manager,
GList *files)
{
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
thunar_clipboard_manager_transfer_files (manager, FALSE, files);
}
/**
* thunar_clipboard_manager_paste_files:
* @manager : a #ThunarClipboardManager.
* @target_path : the #ThunarVfsPath of the folder to which the contents on the clipboard
* should be pasted.
* @widget : a #GtkWidget, on which to perform the paste or %NULL if no widget is
* known.
* @new_files_closure : a #GClosure to connect to the job's "new-files" signal,
* which will be emitted when the job finishes with the
* list of #ThunarVfsPath<!---->s created by the job, or
* %NULL if you're not interested in the signal.
*
* Pastes the contents from the clipboard associated with @manager to the directory
* referenced by @target_path.
**/
void
thunar_clipboard_manager_paste_files (ThunarClipboardManager *manager,
ThunarVfsPath *target_path,
GtkWidget *widget,
GClosure *new_files_closure)
{
ThunarClipboardPasteRequest *request;
g_return_if_fail (THUNAR_IS_CLIPBOARD_MANAGER (manager));
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
/* prepare the paste request */
request = g_new0 (ThunarClipboardPasteRequest, 1);
request->manager = g_object_ref (G_OBJECT (manager));
request->target_path = thunar_vfs_path_ref (target_path);
request->widget = widget;
/* take a reference on the closure (if any) */
if (G_LIKELY (new_files_closure != NULL))
{
request->new_files_closure = new_files_closure;
g_closure_ref (new_files_closure);
g_closure_sink (new_files_closure);
}
/* get notified when the widget is destroyed prior to
* completing the clipboard contents retrieval
*/
if (G_LIKELY (request->widget != NULL))
g_object_add_weak_pointer (G_OBJECT (request->widget), (gpointer) &request->widget);
/* schedule the request */
gtk_clipboard_request_contents (manager->clipboard, manager->x_special_gnome_copied_files,
thunar_clipboard_manager_contents_received, request);
}
|