浏览代码

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 年之前
父节点
当前提交
21c711d46b
共有 1 个文件被更改,包括 6 次插入4 次删除
  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.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();
 		OBSSource src =
 			multiview->GetSourceByPosition(pos.x(), pos.y());