Skip to content

Commit 63199c3

Browse files
committed
Webview: Show menus with exec_()
A user on Windows 10 reported (#3873) that the Track menu was often inadvertently selecting Add Track Above immediately after clicking on the menu icon. The async processing of menu.popup() may be to blame.
1 parent 837cc15 commit 63199c3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/windows/views/webview.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def ShowPlayheadMenu(self, position=None):
429429
Slice_Keep_Right.triggered.connect(partial(
430430
self.Slice_Triggered, MENU_SLICE_KEEP_RIGHT, clip_ids, trans_ids, position))
431431
menu.addMenu(Slice_Menu)
432-
return menu.popup(QCursor.pos())
432+
return menu.exec_(QCursor.pos())
433433

434434
@pyqtSlot(str)
435435
def ShowEffectMenu(self, effect_id=None):
@@ -445,7 +445,7 @@ def ShowEffectMenu(self, effect_id=None):
445445
# Remove Effect Menu
446446
menu.addSeparator()
447447
menu.addAction(self.window.actionRemoveEffect)
448-
return menu.popup(QCursor.pos())
448+
return menu.exec_(QCursor.pos())
449449

450450
@pyqtSlot(float, int)
451451
def ShowTimelineMenu(self, position, layer_id):
@@ -475,7 +475,7 @@ def ShowTimelineMenu(self, position, layer_id):
475475
partial(self.Paste_Triggered, MENU_PASTE, float(position), int(layer_id), [], [])
476476
)
477477

478-
return menu.popup(QCursor.pos())
478+
return menu.exec_(QCursor.pos())
479479

480480
@pyqtSlot(str)
481481
def ShowClipMenu(self, clip_id=None):
@@ -946,7 +946,7 @@ def ShowClipMenu(self, clip_id=None):
946946
menu.addAction(self.window.actionRemoveClip)
947947

948948
# Show Context menu
949-
return menu.popup(QCursor.pos())
949+
return menu.exec_(QCursor.pos())
950950

951951
def Transform_Triggered(self, action, clip_ids):
952952
log.debug("Transform_Triggered")
@@ -2618,7 +2618,7 @@ def ShowTransitionMenu(self, tran_id=None):
26182618
menu.addAction(self.window.actionRemoveTransition)
26192619

26202620
# Show menu
2621-
return menu.popup(QCursor.pos())
2621+
return menu.exec_(QCursor.pos())
26222622

26232623
@pyqtSlot(str)
26242624
def ShowTrackMenu(self, layer_id=None):
@@ -2643,7 +2643,7 @@ def ShowTrackMenu(self, layer_id=None):
26432643
self.window.actionRemoveTrack.setEnabled(True)
26442644
menu.addSeparator()
26452645
menu.addAction(self.window.actionRemoveTrack)
2646-
return menu.popup(QCursor.pos())
2646+
return menu.exec_(QCursor.pos())
26472647

26482648
@pyqtSlot(str)
26492649
def ShowMarkerMenu(self, marker_id=None):
@@ -2654,7 +2654,7 @@ def ShowMarkerMenu(self, marker_id=None):
26542654

26552655
menu = QMenu(self)
26562656
menu.addAction(self.window.actionRemoveMarker)
2657-
return menu.popup(QCursor.pos())
2657+
return menu.exec_(QCursor.pos())
26582658

26592659
@pyqtSlot(str, int)
26602660
def PreviewClipFrame(self, clip_id, frame_number):

0 commit comments

Comments
 (0)