diff options
author | Manuel QuiƱones <manuq@laptop.org> | 2013-04-10 11:17:31 (GMT) |
---|---|---|
committer | Ajay Garg <ajay@activitycentral.com> | 2013-04-13 04:03:34 (GMT) |
commit | ae7acee0221351fcf97045f862831acd50203f56 (patch) | |
tree | 024ba786bf784d0490898cb181c7ae73f1f9b78d | |
parent | 53dbc344b80f08035aa8e22843c9ba5e2c889358 (diff) |
Bring back dragging of elements from the clipboard to the activities - SL #4485
This is another API fix for code not yet ported to GTK+3, similar
to #3819:
- gtk.SelectionData.type -> Gtk.SelectionData.get_data_type()
- context.set_icon_pixbuf(...) -> Gtk.drag_set_icon_pixbuf(context, ...) [2]
[1] https://developer.gnome.org/gtk3/3.5/gtk3-Selections.html#gtk-selection-data-get-data-type
[2] https://developer.gnome.org/gtk3/stable/gtk3-Drag-and-Drop.html#gtk-drag-set-icon-pixbuf
Signed-off-by: Manuel QuiƱones <manuq@laptop.org>
Signed-off-by: Ajay Garg <ajay@activitycentral.com>
-rw-r--r-- | src/jarabe/frame/clipboardicon.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/jarabe/frame/clipboardicon.py b/src/jarabe/frame/clipboardicon.py index 26af595..63ed2e3 100644 --- a/src/jarabe/frame/clipboardicon.py +++ b/src/jarabe/frame/clipboardicon.py @@ -75,10 +75,11 @@ class ClipboardIcon(RadioToolButton): def _drag_data_get_cb(self, widget, context, selection, target_type, event_time): - logging.debug('_drag_data_get_cb: requested target %s', - selection.target) - data = self._cb_object.get_formats()[selection.target].get_data() - selection.set(selection.target, 8, data) + target_atom = selection.get_target() + target_name = target_atom.name() + logging.debug('_drag_data_get_cb: requested target %s', target_name) + data = self._cb_object.get_formats()[target_name].get_data() + selection.set(target_atom, 8, data) def _put_in_clipboard(self): logging.debug('ClipboardIcon._put_in_clipboard') @@ -161,8 +162,8 @@ class ClipboardIcon(RadioToolButton): icon_theme = Gtk.IconTheme.get_default() pixbuf = icon_theme.load_icon(self._icon.props.icon_name, style.STANDARD_ICON_SIZE, 0) - context.set_icon_pixbuf(pixbuf, hot_x=pixbuf.props.width / 2, - hot_y=pixbuf.props.height / 2) + Gtk.drag_set_icon_pixbuf(context, pixbuf, hot_x=pixbuf.props.width / 2, + hot_y=pixbuf.props.height / 2) def _notify_active_cb(self, widget, pspec): if self.props.active: |