diff --git a/source/frontend/patchcanvas/canvasbox.py b/source/frontend/patchcanvas/canvasbox.py index 57198d984..654c141fc 100644 --- a/source/frontend/patchcanvas/canvasbox.py +++ b/source/frontend/patchcanvas/canvasbox.py @@ -612,6 +612,10 @@ class CanvasBox(QGraphicsObject): QGraphicsObject.mouseDoubleClickEvent(self, event) def mousePressEvent(self, event): + if event.button() == Qt.MiddleButton or event.source() == Qt.MouseEventSynthesizedByApplication: + event.ignore() + return + canvas.last_z_value += 1 self.setZValue(canvas.last_z_value) self.resetLinesZValue() diff --git a/source/frontend/patchcanvas/canvasport.py b/source/frontend/patchcanvas/canvasport.py index d308c92fa..f45181bc7 100644 --- a/source/frontend/patchcanvas/canvasport.py +++ b/source/frontend/patchcanvas/canvasport.py @@ -147,6 +147,10 @@ class CanvasPort(QGraphicsItem): QGraphicsItem.hoverLeaveEvent(self, event) def mousePressEvent(self, event): + if event.button() == Qt.MiddleButton or event.source() == Qt.MouseEventSynthesizedByApplication: + event.ignore() + return + if self.m_mouse_down: self.handleMouseRelease() self.m_hover_item = None diff --git a/source/frontend/widgets/draggablegraphicsview.py b/source/frontend/widgets/draggablegraphicsview.py index 57b9ff5ce..1aaa790e7 100644 --- a/source/frontend/widgets/draggablegraphicsview.py +++ b/source/frontend/widgets/draggablegraphicsview.py @@ -119,7 +119,8 @@ class DraggableGraphicsView(QGraphicsView): if event.button() == self.fMiddleButton and not self.fCtrlDown: self.fPanning = True self.setDragMode(QGraphicsView.ScrollHandDrag) - event = QMouseEvent(event.type(), event.pos(), Qt.LeftButton, Qt.LeftButton, event.modifiers()) + event = QMouseEvent(event.type(), event.localPos(), event.windowPos(), event.screenPos(), + Qt.LeftButton, Qt.LeftButton, event.modifiers(), Qt.MouseEventSynthesizedByApplication) QGraphicsView.mousePressEvent(self, event)