From 5caa6055e36cead2a2e5037b6444017f90dea2a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Tue, 21 Aug 2012 01:58:47 -0300
Subject: [PATCH sugar] Fix drag and drop to the clipboard - SL #3811
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
gtk.gdk.DragContext.get_source_widget returns None if the drag is not
made within the same application. This is enough test to say that
it's not an internal drag. The gtk.Viewport comparison is left as
fallback.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
---
src/jarabe/frame/clipboardtray.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/jarabe/frame/clipboardtray.py b/src/jarabe/frame/clipboardtray.py
index 37d5e1a..779ffed 100644
a
|
b
|
class ClipboardTray(tray.VTray): |
216 | 216 | context.drop_finish(True, gtk.get_current_event_time()) |
217 | 217 | |
218 | 218 | def _internal_drag(self, context): |
219 | | view_ancestor = context.get_source_widget().get_ancestor(gtk.Viewport) |
| 219 | source_widget = context.get_source_widget() |
| 220 | if source_widget is None: |
| 221 | return False |
| 222 | view_ancestor = source_widget.get_ancestor(gtk.Viewport) |
220 | 223 | if view_ancestor is self._viewport: |
221 | 224 | return True |
222 | 225 | else: |