@@ -577,6 +577,7 @@ def devtools(self, *kwargs):
577
577
is_drag = False
578
578
is_drag_leave = False # Mouse leaves web view
579
579
drag_data = None
580
+
current_drag_operation = cefpython.DRAG_OPERATION_NONE
580
581
581
582
def on_touch_down(self, touch, *kwargs):
582
583
# Mouse scrolling
@@ -630,7 +631,6 @@ def on_touch_up(self, touch, *kwargs):
630
631
if self.is_drag:
631
632
#print("on_touch_up=%s/%s" % (touch.x,y))
632
633
if self.is_drag_leave or not self.is_inside_web_view(touch.x, y):
633
-
print("~~ DragSourceEndedAt")
634
634
# See comment in is_inside_web_view() - x/y at borders
635
635
# should be treated as outside of web view.
636
636
x = touch.x
@@ -642,15 +642,20 @@ def on_touch_up(self, touch, *kwargs):
642
642
y = -1
643
643
if y == self.height-1:
644
644
y = self.height
645
+
print("~~ DragSourceEndedAt")
646
+
print("~~ current_drag_operation=%s"
647
+
% self.current_drag_operation)
645
648
self.browser.DragSourceEndedAt(x, y,
646
-
cefpython.DRAG_OPERATION_MOVE)
649
+
self.current_drag_operation)
647
650
self.drag_ended()
648
651
else:
649
652
print("~~ DragTargetDrop")
650
653
print("~~ DragSourceEndedAt")
654
+
print("~~ current_drag_operation=%s"
655
+
% self.current_drag_operation)
651
656
self.browser.DragTargetDrop(touch.x, y)
652
657
self.browser.DragSourceEndedAt(touch.x, y,
653
-
cefpython.DRAG_OPERATION_MOVE)
658
+
self.current_drag_operation)
654
659
self.drag_ended()
655
660
656
661
touch.ungrab(self)
@@ -697,7 +702,7 @@ def on_touch_move(self, touch, *kwargs):
697
702
self.is_drag_leave = False
698
703
print("~~ DragTargetDragOver")
699
704
self.browser.DragTargetDragOver(
700
-
touch.x, y, cefpython.DRAG_OPERATION_MOVE)
705
+
touch.x, y, cefpython.DRAG_OPERATION_EVERY)
701
706
self.update_drag_icon(touch.x, y)
702
707
else:
703
708
if not self.is_drag_leave:
@@ -720,6 +725,7 @@ def drag_ended(self):
720
725
self.is_drag = False
721
726
self.is_drag_leave = False
722
727
del self.drag_data
728
+
self.current_drag_operation = cefpython.DRAG_OPERATION_NONE
723
729
self.update_drag_icon(None, None)
724
730
print("~~ DragSourceSystemDragEnded")
725
731
self.browser.DragSourceSystemDragEnded()
@@ -954,13 +960,15 @@ def StartDragging(self, browser, drag_data, allowed_ops, x, y):
954
960
self.browserWidget.is_drag = True
955
961
self.browserWidget.is_drag_leave = False
956
962
self.browserWidget.drag_data = drag_data
963
+
self.browserWidget.current_drag_operation =\
964
+
cefpython.DRAG_OPERATION_NONE
957
965
self.browserWidget.update_drag_icon(x, y)
958
966
return True
959
967
960
968
961
969
def UpdateDragCursor(self, browser, operation):
962
-
# print("~~ UpdateDragCursor(): operation=%s" % operation)
963
-
pass
970
+
#print("~~ UpdateDragCursor(): operation=%s" % operation)
971
+
self.browserWidget.current_drag_operation = operation
964
972
965
973
966
974
if __name__ == '__main__':
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4