~ubuntu-desktop/gnome-shell/ubuntu-artful

« back to all changes in this revision

Viewing changes to debian/patches/git_layout-unset-when-headless.patch

  • Committer: Jeremy Bicha
  • Date: 2017-10-13 20:14:08 UTC
  • Revision ID: jbicha@ubuntu.com-20171013201408-48r12mmd4800q270
Cherry-pick git_layout-unset-when-headless.patch from gnome-3-26
branch to fix crash bug (LP: #1717170)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
1717170From 5f8a5114833d7d31d4bd64affbd323bb7252c3d0 Mon Sep 17 00:00:00 2001
 
2
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
 
3
Date: Fri, 6 Oct 2017 20:26:24 -0400
 
4
Subject: layout: Unset primary and bottom monitor when headless
 
5
 
 
6
We were handling being initially headless by only setting the primary
 
7
and bottom monitor if there was any primary monitor, then checking the
 
8
primary monitor reference before making calls assuming there was any
 
9
monitors.
 
10
 
 
11
What we didn't do was unset the primary and bottom monitor when going
 
12
headless, meaning that temporarly disconnecting a monitor while having
 
13
windows open caused an assert to be triggered due to various code paths
 
14
taking the path assuming there are valid monitors.
 
15
 
 
16
Unsetting both the primary and bottom monitor when going headless avoids
 
17
the code paths in the same way as they were avoided when starting
 
18
headless.
 
19
 
 
20
https://bugzilla.gnome.org/show_bug.cgi?id=788607
 
21
---
 
22
 js/ui/layout.js | 3 +++
 
23
 1 file changed, 3 insertions(+)
 
24
 
 
25
diff --git a/js/ui/layout.js b/js/ui/layout.js
 
26
index 304c2a1..2f18947 100644
 
27
--- a/js/ui/layout.js
 
28
+++ b/js/ui/layout.js
 
29
@@ -351,6 +351,9 @@ var LayoutManager = new Lang.Class({
 
30
                 this._loadBackground();
 
31
                 this._pendingLoadBackground = false;
 
32
             }
 
33
+        } else {
 
34
+            this.primaryMonitor = null;
 
35
+            this.bottomMonitor = null;
 
36
         }
 
37
     },
 
38