From ae7acee0221351fcf97045f862831acd50203f56 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Wed, 10 Apr 2013 11:17:31 +0000 Subject: 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 Signed-off-by: Ajay Garg --- 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: -- cgit v0.9.1