mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Fix crash when right-clicking twice on fullscreen panel
If you right click once on the fullscreen panel and the context menu pop up then you right click again somewhere else on the panel *while the previous context menu is still visible* then it will cause a crash with : "Windows fatal exception: access violation" It seems to be caused by a crash in the QT event loop, trying to delete the existing QMenu within an event handler.
This commit is contained in:
parent
3f217257c4
commit
a6942b7923
|
@ -359,6 +359,7 @@ class myPanel(QWidget):
|
|||
self.show()
|
||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||
self._autoHide = True
|
||||
self._m = None
|
||||
|
||||
if not vertical:
|
||||
self.setLayout(QHBoxLayout())
|
||||
|
@ -379,6 +380,8 @@ class myPanel(QWidget):
|
|||
|
||||
def mouseReleaseEvent(self, event):
|
||||
if event.button() == Qt.RightButton:
|
||||
if self._m:
|
||||
self._m.deleteLater()
|
||||
m = QMenu()
|
||||
a = QAction(self.tr("Auto-hide"), m)
|
||||
a.setCheckable(True)
|
||||
|
|
Loading…
Reference in a new issue