Browse Source

UI: Ignore left-click on non-multiview projectors

Fixes a crash that could occur after having both multiview and
non-multiview projectors active.
Richard Stanway 3 năm trước cách đây
mục cha
commit
21c711d46b
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      UI/window-projector.cpp

+ 6 - 4
UI/window-projector.cpp

@@ -274,12 +274,14 @@ void OBSProjector::mousePressEvent(QMouseEvent *event)
 
 
 		popup.addAction(QTStr("Close"), this, SLOT(EscapeTriggered()));
 		popup.addAction(QTStr("Close"), this, SLOT(EscapeTriggered()));
 		popup.exec(QCursor::pos());
 		popup.exec(QCursor::pos());
-	}
+	} else if (event->button() == Qt::LeftButton) {
+		// Only MultiView projectors handle left click
+		if (this->type != ProjectorType::Multiview)
+			return;
 
 
-	if (!mouseSwitching)
-		return;
+		if (!mouseSwitching)
+			return;
 
 
-	if (event->button() == Qt::LeftButton) {
 		QPoint pos = event->pos();
 		QPoint pos = event->pos();
 		OBSSource src =
 		OBSSource src =
 			multiview->GetSourceByPosition(pos.x(), pos.y());
 			multiview->GetSourceByPosition(pos.x(), pos.y());