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.
This commit is contained in:
Rafostar
2022-05-29 10:19:41 +02:00
parent 8f22b36045
commit e7808df7cc

View File

@@ -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);
}