Commit 7e9d5870 authored by Benoit's avatar Benoit Committed by Jean-Baptiste Kempf

Qt: videos can no longer be larger than the screen

If an attempt is made to resize the video widget to a size larger than the screen,
it will be resized to a sensible size, filling the screen instead.

Close #12852
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent d046eab5
......@@ -784,9 +784,33 @@ void MainInterface::setVideoSize( unsigned int w, unsigned int h )
/* Resize video widget to video size, or keep it at the same
* size. Call setSize() either way so that vout_window_ReportSize
* will always get called.
* If the video size is too large for the screen, resize it
* to the screen size.
*/
if (b_autoresize)
{
QRect screen = QApplication::desktop()->availableGeometry();
if( h > screen.height() )
{
w = screen.width();
h = screen.height();
if( !b_minimalView )
{
if( menuBar()->isVisible() )
h -= menuBar()->height();
if( controls->isVisible() )
h -= controls->height();
if( statusBar()->isVisible() )
h -= statusBar()->height();
if( inputC->isVisible() )
h -= inputC->height();
}
h -= style()->pixelMetric(QStyle::PM_TitleBarHeight);
h -= style()->pixelMetric(QStyle::PM_LayoutBottomMargin);
h -= 2 * style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
}
videoWidget->setSize( w, h );
}
else
videoWidget->setSize( videoWidget->width(), videoWidget->height() );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment