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

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