Skip to content

Commit

Permalink
Update OBSSourceView.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Warchamp7 committed Feb 20, 2025
1 parent dc3bb86 commit 395b5ac
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/widgets/OBSSourceView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void OBSSourceWidget::resizeSourceView()
return;
}

// ToDo: Find a better fix
sourceView->move(0, 1);
sourceView->move(0, 0);

double aspectRatio = fixedAspectRatio > 0
? fixedAspectRatio
: (double)sourceView->sourceWidth() / (double)sourceView->sourceHeight();
Expand Down Expand Up @@ -79,6 +75,15 @@ void OBSSourceWidget::resizeSourceView()
void OBSSourceWidget::moveEvent(QMoveEvent *event)
{
resizeSourceView();

QWindow *nativeWindow = sourceView->windowHandle();

if (nativeWindow) {
QPoint position = sourceView->mapTo(sourceView->nativeParentWidget(), QPoint());

nativeWindow->setGeometry(QRect(position, sourceView->geometry().size()));
}

QFrame::moveEvent(event);
}

Expand Down

0 comments on commit 395b5ac

Please # to comment.