Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0, 1.0.1, and 1.0.2

history: prevent doubled calling of DnD event on gtk.Entry

Changeset 564d4ebf1586

Parent 51539fb51f45

by Yuki KODAMA

Changes to one file · Browse files at 564d4ebf1586 Showing diff from parent 51539fb51f45 Diff from another changeset...

 
2013
2014
2015
 
 
 
 
 
 
 
 
 
 
2016
2017
2018
 
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
@@ -2013,6 +2013,16 @@
  self.set_bundlefile(path)   else:   self.pathentry.set_text(path) + + # HACK: I don't know why, but 'drag-data-received' signal + # is emitted twice: the former has correct dropped path, + # the latter has previously dropped (old) path. To avoid + # overwriting with old one, I had to block dnd signal + # right after this signal handler is called. + widget.handler_block_by_func(self.dnd_received) + def after(): + widget.handler_unblock_by_func(self.dnd_received) + gtklib.idle_add_single_call(after)   elif dest == DND_DEST_GRAPHVIEW:   self.import_clicked(None, thgimport.DEST_REPO, paths)   else: