Blame SOURCES/0003-window-wayland-Handle-resizing-when-headless.patch

e47e58
From 07e5f7ef29b5567e090221d5da9415e8b84c0ebb Mon Sep 17 00:00:00 2001
e47e58
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
e47e58
Date: Mon, 16 Oct 2017 17:02:51 +0800
e47e58
Subject: [PATCH 3/4] window/wayland: Handle resizing when headless
e47e58
e47e58
We tried to get the geometry scale, which may depend on the main
e47e58
logical monitor assigned to the window. To avoid dereferencing a NULL
e47e58
logical monitor when headless, instead assume the geometry scale is 1.
e47e58
e47e58
https://bugzilla.gnome.org/show_bug.cgi?id=788764
e47e58
---
e47e58
 src/wayland/meta-window-wayland.c | 8 ++++++--
e47e58
 1 file changed, 6 insertions(+), 2 deletions(-)
e47e58
e47e58
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
e47e58
index ed6e34b43..f3f0e1688 100644
e47e58
--- a/src/wayland/meta-window-wayland.c
e47e58
+++ b/src/wayland/meta-window-wayland.c
e47e58
@@ -67,6 +67,8 @@ G_DEFINE_TYPE (MetaWindowWayland, meta_window_wayland, META_TYPE_WINDOW)
e47e58
 static int
e47e58
 get_window_geometry_scale_for_logical_monitor (MetaLogicalMonitor *logical_monitor)
e47e58
 {
e47e58
+  g_assert (logical_monitor);
e47e58
+
e47e58
   if (meta_is_stage_views_scaled ())
e47e58
     return 1;
e47e58
   else
e47e58
@@ -79,8 +81,7 @@ meta_window_wayland_manage (MetaWindow *window)
e47e58
   MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
e47e58
   MetaDisplay *display = window->display;
e47e58
 
e47e58
-  wl_window->geometry_scale =
e47e58
-    get_window_geometry_scale_for_logical_monitor (window->monitor);
e47e58
+  wl_window->geometry_scale = meta_window_wayland_get_geometry_scale (window);
e47e58
 
e47e58
   meta_display_register_wayland_window (display, window);
e47e58
 
e47e58
@@ -634,6 +635,9 @@ should_do_pending_move (MetaWindowWayland *wl_window,
e47e58
 int
e47e58
 meta_window_wayland_get_geometry_scale (MetaWindow *window)
e47e58
 {
e47e58
+  if (!window->monitor)
e47e58
+    return 1;
e47e58
+
e47e58
   return get_window_geometry_scale_for_logical_monitor (window->monitor);
e47e58
 }
e47e58
 
e47e58
-- 
e47e58
2.14.2
e47e58