gnu: gd: Fix failing test on i686.
[jackhill/guix/guix.git] / gnu / packages / patches / inkscape-drop-wait-for-targets.patch
CommitLineData
8e359335
SB
1Copied from Fedora.
2
3http://pkgs.fedoraproject.org/cgit/rpms/inkscape.git/plain/inkscape-0.91-drop-wait-for-targets.patch?id=eb5340800b563d6b05aa5f11a2f24f2cc0d8c80e
4
5=== modified file 'src/ui/clipboard.cpp'
6--- src/ui/clipboard.cpp 2016-04-02 15:15:43 +0000
7+++ src/ui/clipboard.cpp 2016-04-07 16:30:32 +0000
8@@ -146,8 +146,6 @@
9 void _setClipboardColor(guint32);
10 void _userWarn(SPDesktop *, char const *);
11
12- void _inkscape_wait_for_targets(std::list<Glib::ustring> &);
13-
14 // private properites
15 SPDocument *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it
16 Inkscape::XML::Node *_defs; ///< Reference to the clipboard document's defs node
17@@ -1302,9 +1300,7 @@
18 */
19 Glib::ustring ClipboardManagerImpl::_getBestTarget()
20 {
21- // GTKmm's wait_for_targets() is broken, see the comment in _inkscape_wait_for_targets()
22- std::list<Glib::ustring> targets; // = _clipboard->wait_for_targets();
23- _inkscape_wait_for_targets(targets);
24+ std::list<Glib::ustring> targets = _clipboard->wait_for_targets();
25
26 // clipboard target debugging snippet
27 /*
28@@ -1456,39 +1452,6 @@
29 desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, msg);
30 }
31
32-
33-// GTKMM's clipboard::wait_for_targets is buggy and might return bogus, see
34-//
35-// https://bugs.launchpad.net/inkscape/+bug/296778
36-// http://mail.gnome.org/archives/gtk-devel-list/2009-June/msg00062.html
37-//
38-// for details. Until this has been fixed upstream we will use our own implementation
39-// of this method, as copied from /gtkmm-2.16.0/gtk/gtkmm/clipboard.cc.
40-void ClipboardManagerImpl::_inkscape_wait_for_targets(std::list<Glib::ustring> &listTargets)
41-{
42- //Get a newly-allocated array of atoms:
43- GdkAtom* targets = NULL;
44- gint n_targets = 0;
45- gboolean test = gtk_clipboard_wait_for_targets( gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), &targets, &n_targets );
46- if (!test || (targets == NULL)) {
47- return;
48- }
49-
50- //Add the targets to the C++ container:
51- for (int i = 0; i < n_targets; i++)
52- {
53- //Convert the atom to a string:
54- gchar* const atom_name = gdk_atom_name(targets[i]);
55-
56- Glib::ustring target;
57- if (atom_name) {
58- target = Glib::ScopedPtr<char>(atom_name).get(); //This frees the gchar*.
59- }
60-
61- listTargets.push_back(target);
62- }
63-}
64-
65 /* #######################################
66 ClipboardManager class
67 ####################################### */
68