From ad1b1ecc79505bbdcc35d5d3e8d3904253dd1c73 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 20 Feb 2010 23:05:51 +0000 Subject: [PATCH] Fix drag and drop, which had become horribly sensitive to the internal widget structure of Terminal --- terminatorlib/terminal.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 4123d612..786b0264 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -19,6 +19,7 @@ from util import dbg, err, gerr, get_top_window import util from config import Config from cwd import get_default_cwd +from factory import Factory from terminator import Terminator from titlebar import Titlebar from terminal_popup_menu import TerminalPopupMenu @@ -860,7 +861,19 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) return srchbox = widgetsrc - dsthbox = widget.get_parent().get_parent() + + # The widget argument is actually a vte.Terminal(). Turn that into a + # terminatorlib Terminal() + maker = Factory() + while True: + widget = widget.get_parent() + if not widget: + # We've run out of widgets. Something is wrong. + return + if maker.isinstance(widget, 'Terminal'): + break + + dsthbox = widget dstpaned = dsthbox.get_parent() srcpaned = srchbox.get_parent()