From e7808df7cca8b4f7e86ac036665d66dce40a5c73 Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sun, 29 May 2022 10:19:41 +0200 Subject: [PATCH] plugin: paintable: Fix widget size calculations on non-100% display scaling Unlike legacy sink that used GLArea, GdkPaintable snapshots without pre-multiplying sizes with scale factor. Remove scaling multiply of our widget dimensions, so both video and widget width/height will be calculated correctly. This fixes both image and black borders displaying issues on displays with non-100% scaling applied. --- lib/gst/plugin/gstclapperpaintable.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/gst/plugin/gstclapperpaintable.c b/lib/gst/plugin/gstclapperpaintable.c index 5b2a93c3..5710355d 100644 --- a/lib/gst/plugin/gstclapperpaintable.c +++ b/lib/gst/plugin/gstclapperpaintable.c @@ -376,11 +376,8 @@ gst_clapper_paintable_snapshot (GdkPaintable *paintable, gint widget_width = 0, widget_height = 0; if ((widget = g_weak_ref_get (&self->widget))) { - gint scale_factor; - - scale_factor = gtk_widget_get_scale_factor (widget); - widget_width = gtk_widget_get_width (widget) * scale_factor; - widget_height = gtk_widget_get_height (widget) * scale_factor; + widget_width = gtk_widget_get_width (widget); + widget_height = gtk_widget_get_height (widget); g_object_unref (widget); }