Skip to content

Commit 9b1a77f

Browse files
committed
No longer trigger an event, but directly delete a clip which is no longer needed during drag/drop. This solves a nasty asny issue where a clip would "stick" on the timeline, due to out of order JS and Python calls
1 parent 138defb commit 9b1a77f

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/classes/thumbnail.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ def log_error(self, msg_format, *args):
127127
log.error(msg_format % args)
128128

129129
def do_GET(self):
130-
# Pause processing of request (since we don't currently use thread pooling, this allows
131-
# the threads to be processed without choking the CPU as much
132-
# TODO: Make HTTPServer work with a limited thread pool and remove this sleep() hack.
133-
time.sleep(0.01)
134-
135130
""" Process each GET request and return a value (image or file path)"""
136131
# Parse URL
137132
url_output = REGEX_THUMBNAIL_URL.match(self.path)
@@ -196,4 +191,9 @@ def do_GET(self):
196191
self.wfile.write(open(thumb_path, 'rb').read())
197192
else:
198193
self.wfile.write(bytes(thumb_path, "utf-8"))
199-
return
194+
195+
# Pause processing of request (since we don't currently use thread pooling, this allows
196+
# the threads to be processed without choking the CPU as much
197+
# TODO: Make HTTPServer work with a limited thread pool and remove this sleep() hack.
198+
time.sleep(0.01)
199+

src/windows/views/timeline_webview.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -3029,10 +3029,20 @@ def dragLeaveEvent(self, event):
30293029
# Accept event
30303030
event.accept()
30313031

3032+
# Clear selected clips
3033+
get_app().window.removeSelection(self.item_id, self.item_type)
3034+
30323035
if self.item_type == "clip":
3033-
get_app().window.actionRemoveClip.trigger()
3036+
# Delete dragging clip
3037+
clips = Clip.filter(id=self.item_id)
3038+
for c in clips:
3039+
c.delete()
3040+
30343041
elif self.item_type == "transition":
3035-
get_app().window.actionRemoveTransition.trigger()
3042+
# Delete dragging transitions
3043+
transitions = Transition.filter(id=self.item_id)
3044+
for t in transitions:
3045+
t.delete()
30363046

30373047
# Clear new clip
30383048
self.new_item = False

0 commit comments

Comments
 (0)