mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-06 07:36:12 -05:00
UI: Allow resize without timers
This prevents the weird stretching effect that occurs whenever a windows is in the process of being resized by the user. Originally it was intended as an optimization, but even on half-decent computers it doesn't really have much benefit.
This commit is contained in:
@@ -1956,9 +1956,8 @@ void OBSBasic::ResizePreview(uint32_t cx, uint32_t cy)
|
||||
previewY += float(PREVIEW_EDGE_SIZE);
|
||||
|
||||
if (isVisible()) {
|
||||
if (resizeTimer)
|
||||
killTimer(resizeTimer);
|
||||
resizeTimer = startTimer(100);
|
||||
QSize size = GetPixelSize(ui->preview);
|
||||
obs_resize(size.width(), size.height());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2057,18 +2056,7 @@ void OBSBasic::resizeEvent(QResizeEvent *event)
|
||||
if (obs_get_video_info(&ovi))
|
||||
ResizePreview(ovi.base_width, ovi.base_height);
|
||||
|
||||
UNUSED_PARAMETER(event);
|
||||
}
|
||||
|
||||
void OBSBasic::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
if (event->timerId() == resizeTimer) {
|
||||
killTimer(resizeTimer);
|
||||
resizeTimer = 0;
|
||||
|
||||
QSize size = GetPixelSize(ui->preview);
|
||||
obs_resize(size.width(), size.height());
|
||||
}
|
||||
OBSMainWindow::resizeEvent(event);
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionShow_Recordings_triggered()
|
||||
|
||||
Reference in New Issue
Block a user