screen-cast: Fix monitor recording on HiDPI
authorJonas Ådahl <jadahl@gmail.com>
Fri, 25 Jan 2019 21:06:39 +0000 (21:06 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Thu, 14 Mar 2019 18:39:31 +0000 (18:39 +0000)
It scaled the logical monitor rect with scale to get the stream
dimensions, but that is only valid when having
'scale-monitor-framebuffers' enabled. Even when it was, it didn't work
properly, as clutter_stage_capture_into() doesn't work properly with
scaled monitor framebuffers yet.

(cherry picked from commit 3fa6a92cc5dda6ab3939c3e982185f6caf453360)

Bug: https://gitlab.gnome.org/GNOME/mutter/merge_requests/415
Applied-upstream: 3.30.3, commit:1c57a5842069735b7bb80846130bf61d0e0a0880

Gbp-Pq: Name screen-cast-Fix-monitor-recording-on-HiDPI.patch

src/backends/meta-screen-cast-monitor-stream-src.c

index 382d7d4a26d030498e179c9c3f241c0a1de2ade7..093e9f2368296c8053f6713b603e9fd2d2dec734 100644 (file)
@@ -87,7 +87,11 @@ meta_screen_cast_monitor_stream_src_get_specs (MetaScreenCastStreamSrc *src,
   logical_monitor = meta_monitor_get_logical_monitor (monitor);
   mode = meta_monitor_get_current_mode (monitor);
 
-  scale = logical_monitor->scale;
+  if (meta_is_stage_views_scaled ())
+    scale = logical_monitor->scale;
+  else
+    scale = 1.0;
+
   *width = (int) roundf (logical_monitor->rect.width * scale);
   *height = (int) roundf (logical_monitor->rect.height * scale);
   *frame_rate = meta_monitor_mode_get_refresh_rate (mode);