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