Browse Source

UI: Fix projector not working on secondary monitors

This fixes a bug where the projector wouldn't work on secondary
monitors on Windows.
Clayton Groeneveld 5 years ago
parent
commit
1eba0827b7
1 changed files with 6 additions and 7 deletions
  1. 6 7
      UI/window-projector.cpp

+ 6 - 7
UI/window-projector.cpp

@@ -24,10 +24,13 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
 	  removedSignal(obs_source_get_signal_handler(source), "remove",
 			OBSSourceRemoved, this)
 {
-	type = type_;
+	isAlwaysOnTop = config_get_bool(GetGlobalConfig(), "BasicWindow",
+					"ProjectorAlwaysOnTop");
 
-	SetAlwaysOnTop(this, config_get_bool(GetGlobalConfig(), "BasicWindow",
-					     "ProjectorAlwaysOnTop"));
+	if (isAlwaysOnTop)
+		setWindowFlags(Qt::WindowStaysOnTopHint);
+
+	type = type_;
 
 	setWindowIcon(QIcon::fromTheme("obs", QIcon(":/res/images/obs.png")));
 
@@ -43,10 +46,6 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
 	addAction(action);
 	connect(action, SIGNAL(triggered()), this, SLOT(EscapeTriggered()));
 
-	isAlwaysOnTop = config_get_bool(GetGlobalConfig(), "BasicWindow",
-					"ProjectorAlwaysOnTop");
-	SetAlwaysOnTop(this, isAlwaysOnTop);
-
 	setAttribute(Qt::WA_DeleteOnClose, true);
 
 	//disable application quit when last window closed