summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/examples/gl/gtk/3dvideo/main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/examples/gl/gtk/3dvideo/main.cpp b/tests/examples/gl/gtk/3dvideo/main.cpp
index ec5951b1c..4f12b11cc 100644
--- a/tests/examples/gl/gtk/3dvideo/main.cpp
+++ b/tests/examples/gl/gtk/3dvideo/main.cpp
@@ -117,9 +117,16 @@ static gboolean
resize_cb (GtkWidget * widget, GdkEvent * event, gpointer sink)
{
GtkAllocation allocation;
+ gint scale = 1;
+
+#if GTK_CHECK_VERSION(3, 10, 0)
+ scale = gtk_widget_get_scale_factor (widget);
+#endif
gtk_widget_get_allocation (widget, &allocation);
- gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (sink), allocation.x, allocation.y, allocation.width, allocation.height);
+ gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (sink),
+ allocation.x * scale, allocation.y * scale, allocation.width * scale,
+ allocation.height * scale);
return G_SOURCE_CONTINUE;
}