Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Remove unnecessary projector variable #11215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions UI/window-projector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,12 @@ OBSProjector::~OBSProjector()
}

App()->DecrementSleepInhibition();

screen = nullptr;
}

void OBSProjector::SetMonitor(int monitor)
{
savedMonitor = monitor;
screen = QGuiApplication::screens()[monitor];
setGeometry(screen->geometry());
setGeometry(QGuiApplication::screens()[monitor]->geometry());
showFullScreen();
SetHideCursor();
}
Expand Down Expand Up @@ -457,7 +454,6 @@ void OBSProjector::OpenWindowedProjector()

OBSSource source = GetSource();
UpdateProjectorTitle(QT_UTF8(obs_source_get_name(source)));
screen = nullptr;
}

void OBSProjector::ResizeToContent()
Expand Down Expand Up @@ -516,11 +512,11 @@ void OBSProjector::SetIsAlwaysOnTop(bool isAlwaysOnTop, bool isOverridden)
SetAlwaysOnTop(this, isAlwaysOnTop);
}

void OBSProjector::ScreenRemoved(QScreen *screen_)
void OBSProjector::ScreenRemoved(QScreen *screen)
{
if (GetMonitor() < 0 || !screen)
if (GetMonitor() < 0)
return;

if (screen == screen_)
if (screen == this->screen())
EscapeTriggered();
}
4 changes: 1 addition & 3 deletions UI/window-projector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ class OBSProjector : public OBSQTDisplay {
QRect prevGeometry;
void SetMonitor(int monitor);

QScreen *screen = nullptr;

private slots:
void EscapeTriggered();
void OpenFullScreenProjector();
void ResizeToContent();
void OpenWindowedProjector();
void AlwaysOnTopToggled(bool alwaysOnTop);
void ScreenRemoved(QScreen *screen_);
void ScreenRemoved(QScreen *screen);
void RenameProjector(QString oldName, QString newName);

public:
Expand Down