diff --git a/pronterface.py b/pronterface.py index 2adbf6c..e74b41c 100755 --- a/pronterface.py +++ b/pronterface.py @@ -866,6 +866,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole): elif e.Dragging() and e.ButtonIsDown(wx.MOUSE_BTN_LEFT): obj = e.GetEventObject() scrpos = obj.ClientToScreen(e.GetPosition()) + if not hasattr(self,"dragpos"): + self.dragpos = scrpos + e.Skip() + return + else: + dx,dy=self.dragpos[0]-scrpos[0],self.dragpos[1]-scrpos[1] + if dx*dx+dy*dy < 5*5: # threshold to detect dragging for jittery mice + e.Skip() + return if not hasattr(self,"dragging"): # init dragging of the custom button if hasattr(obj,"custombutton"): @@ -945,6 +954,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): del self.dragging wx.CallAfter(self.cbuttons_reload) del self.last_drag_dest + del self.dragpos else: e.Skip()