[vlc-devel] [PATCH] qt: fix double resize of video widget on hidpi screen

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Jun 7 11:07:03 CEST 2017


On Sat, Jun 3, 2017, at 08:11 PM, Anatolii Aniskovych wrote:
> ---
>  modules/gui/qt/main_interface.cpp | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/gui/qt/main_interface.cpp
> b/modules/gui/qt/main_interface.cpp
> index 561e502d7b..bec22ea53c 100644
> --- a/modules/gui/qt/main_interface.cpp
> +++ b/modules/gui/qt/main_interface.cpp
> @@ -733,8 +733,16 @@ void MainInterface::getVideoSlot( struct
> vout_window_t *p_wnd,
>          showVideo();
>  
>          /* Ask videoWidget to resize correctly, if we are in normal mode
>          */
> -        if( b_autoresize )
> +        if( b_autoresize ) {
> +#if HAS_QT56
> +            qreal factor = videoWidget->devicePixelRatioF();
> +
> +            i_width = qRound( (qreal) i_width / factor );
> +            i_height = qRound( (qreal) i_height / factor );
> +#endif
> +
>              videoWidget->setSize( i_width, i_height );
> +        }
>      }
>  }
>  
> -- 
> 2.13.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

LGTM. Other opinion? If not I'll most likely push this later today

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list