@@ -1192,7 +1192,8 @@ def populate(self, active_person):
11921192 # set the busy cursor, so the user knows that we are working
11931193 self .uistate .set_busy_cursor (True )
11941194
1195- self ._in_drag = False
1195+ self ._in_drag = False # True - when drag can be started
1196+ self ._do_drag = False # True - when drag is started
11961197 self .clear ()
11971198 self .active_person_handle = active_person
11981199
@@ -1357,7 +1358,10 @@ def motion_notify_event(self, item, target, event):
13571358 self .vadjustment .set_value (new_y )
13581359 return True
13591360
1360- if self ._in_drag and (event .type == Gdk .EventType .MOTION_NOTIFY ):
1361+ if not (event .type == Gdk .EventType .MOTION_NOTIFY ):
1362+ return False
1363+
1364+ if self ._in_drag and (not self ._do_drag ):
13611365 # start drag when cursor moved more then 5
13621366 # to separate it from simple click
13631367 if ((abs (self ._last_x - event .x_root ) > 5 )
@@ -1371,11 +1375,8 @@ def motion_notify_event(self, item, target, event):
13711375
13721376 # translate to drag_widget coords
13731377 scale_coef = self .canvas .get_scale ()
1374- bounds = self .canvas .get_root_item ().get_bounds ()
1375- height_canvas = bounds .y2 - bounds .y1
13761378 x = self ._last_x * scale_coef - self .hadjustment .get_value ()
1377- y = ((height_canvas + self ._last_y ) * scale_coef -
1378- self .vadjustment .get_value ())
1379+ y = self ._last_y * scale_coef - self .vadjustment .get_value ()
13791380
13801381 # setup targets
13811382 tglist = Gtk .TargetList .new ([])
@@ -1394,14 +1395,12 @@ def motion_notify_event(self, item, target, event):
13941395 # allow drag to a text document, info on drag_get will be 1
13951396 tglist .add_text_targets (1 )
13961397
1397- drag_widget = self .get_widget ()
1398- # change event window
1399- event .window = drag_widget .get_window ()
14001398 # start drag
1399+ drag_widget = self .get_widget ()
14011400 drag_widget .drag_begin_with_coordinates (
14021401 tglist ,
14031402 Gdk .DragAction .COPY ,
1404- Gdk . KEY_Pointer_Button1 ,
1403+ 1 , # left mouse button = 1
14051404 event ,
14061405 x , y )
14071406 return True
@@ -1500,6 +1499,7 @@ def cb_drag_begin(self, widget, context):
15001499 """
15011500 Called on start drag.
15021501 """
1502+ self ._do_drag = True
15031503 tgs = [x .name () for x in context .list_targets ()]
15041504 # set icon depending on person or family drag
15051505 if DdTargets .PERSON_LINK .drag_type in tgs :
@@ -1512,6 +1512,7 @@ def cb_drag_end(self, widget, context):
15121512 Called when drag is end.
15131513 """
15141514 self ._in_drag = False
1515+ self ._do_drag = False
15151516
15161517 def cb_drag_data_get (self , widget , context , sel_data , info , time ):
15171518 """
0 commit comments