From: Colin Kinloch Date: Mon, 7 Nov 2022 11:08:18 +0000 (+0000) Subject: wayland: calculate union of geometry of all monitors for toplevel bounds X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=81e72c94b570fcdb5a1c38bc0c1669bdd07f4e70;p=gtk4.git wayland: calculate union of geometry of all monitors for toplevel bounds Signed-off-by: Colin Kinloch Origin: upstream, 4.8.3, commit:e551a9d1c4cbd66be04a1c45af172e7b5872f99c Gbp-Pq: Name wayland-calculate-union-of-geometry-of-all-monitors-for-t.patch --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 225d380536..26eacf7c0c 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -1416,21 +1416,22 @@ configure_toplevel_geometry (GdkSurface *surface) else { GdkMonitor *monitor; - GdkRectangle monitor_geometry; + GListModel *monitors; + GdkRectangle monitor_geometry, display_geometry = { 0 }; + guint i; - monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0); - if (monitor) + monitors = gdk_display_get_monitors (display); + + for (i = 0; i < g_list_model_get_n_items (monitors); i++) { + monitor = g_list_model_get_item (monitors, i); gdk_monitor_get_geometry (monitor, &monitor_geometry); - bounds_width = monitor_geometry.width; - bounds_height = monitor_geometry.height; + gdk_rectangle_union (&display_geometry, &monitor_geometry, &display_geometry); g_object_unref (monitor); } - else - { - bounds_width = 0; - bounds_height = 0; - } + + bounds_width = display_geometry.width; + bounds_height = display_geometry.height; } gdk_toplevel_size_init (&size, bounds_width, bounds_height);