@@ -1103,20 +1103,10 @@ def __init__(self, view, dbstate, uistate):
11031103
11041104 # setup drag and drop
11051105 drag_widget = self .get_widget ()
1106- drag_widget .drag_source_set (Gdk .ModifierType .BUTTON1_MASK , [],
1107- Gdk .DragAction .COPY )
11081106 drag_widget .connect ("drag_data_get" , self .cb_drag_data_get )
11091107 drag_widget .connect ("drag_begin" , self .cb_drag_begin )
11101108 drag_widget .connect ("drag_end" , self .cb_drag_end )
11111109
1112- tglist = Gtk .TargetList .new ([])
1113- tglist .add (DdTargets .PERSON_LINK .atom_drag_type ,
1114- DdTargets .PERSON_LINK .target_flags ,
1115- DdTargets .PERSON_LINK .app_id )
1116- # allow drag to a text document, info on drag_get will be 0L !
1117- tglist .add_text_targets (0 )
1118- drag_widget .drag_source_set_target_list (tglist )
1119-
11201110 def add_popover (self , widget , container ):
11211111 """
11221112 Add popover for button.
@@ -1618,16 +1608,25 @@ def motion_notify_event(self, _item, _target, event):
16181608 self .click_events .clear ()
16191609
16201610 # translate to drag_widget coords
1621- drag_widget = self .get_widget ()
16221611 scale_coef = self .canvas .get_scale ()
16231612 bounds = self .canvas .get_root_item ().get_bounds ()
16241613 height_canvas = bounds .y2 - bounds .y1
16251614 x = self ._last_x * scale_coef - self .hadjustment .get_value ()
16261615 y = ((height_canvas + self ._last_y ) * scale_coef -
16271616 self .vadjustment .get_value ())
16281617
1618+ # setup targets
1619+ tglist = Gtk .TargetList .new ([])
1620+ tglist .add (DdTargets .PERSON_LINK .atom_drag_type ,
1621+ DdTargets .PERSON_LINK .target_flags ,
1622+ DdTargets .PERSON_LINK .app_id )
1623+ # allow drag to a text document, info on drag_get will be 0L !
1624+ tglist .add_text_targets (0 )
1625+
1626+ # start drag
1627+ drag_widget = self .get_widget ()
16291628 drag_widget .drag_begin_with_coordinates (
1630- drag_widget . drag_source_get_target_list () ,
1629+ tglist ,
16311630 Gdk .DragAction .COPY ,
16321631 Gdk .ModifierType .BUTTON1_MASK ,
16331632 event ,
0 commit comments