From 62d949674d5cbc2cfc2daebe33ce655e948cf9e605f2f4f0a4359de3f11dd020 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 20 Oct 2017 14:15:24 +0000 Subject: [PATCH] Accepting request 535473 from home:mgorse:branches:GNOME:Factory - Add gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch: fixes a crash when the monitor is turned off (bgo#788607). OBS-URL: https://build.opensuse.org/request/show/535473 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-shell?expand=0&rev=341 --- ...ary-and-bottom-monitor-when-headless.patch | 41 +++++++++++++++++++ gnome-shell.changes | 7 ++++ gnome-shell.spec | 3 ++ 3 files changed, 51 insertions(+) create mode 100644 gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch diff --git a/gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch b/gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch new file mode 100644 index 0000000..7cf76a2 --- /dev/null +++ b/gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch @@ -0,0 +1,41 @@ +From 5f8a5114833d7d31d4bd64affbd323bb7252c3d0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Fri, 6 Oct 2017 20:26:24 -0400 +Subject: [PATCH] layout: Unset primary and bottom monitor when headless + +We were handling being initially headless by only setting the primary +and bottom monitor if there was any primary monitor, then checking the +primary monitor reference before making calls assuming there was any +monitors. + +What we didn't do was unset the primary and bottom monitor when going +headless, meaning that temporarly disconnecting a monitor while having +windows open caused an assert to be triggered due to various code paths +taking the path assuming there are valid monitors. + +Unsetting both the primary and bottom monitor when going headless avoids +the code paths in the same way as they were avoided when starting +headless. + +https://bugzilla.gnome.org/show_bug.cgi?id=788607 +--- + js/ui/layout.js | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/js/ui/layout.js b/js/ui/layout.js +index 304c2a152..2f1894775 100644 +--- a/js/ui/layout.js ++++ b/js/ui/layout.js +@@ -351,6 +351,9 @@ var LayoutManager = new Lang.Class({ + this._loadBackground(); + this._pendingLoadBackground = false; + } ++ } else { ++ this.primaryMonitor = null; ++ this.bottomMonitor = null; + } + }, + +-- +2.14.2 + diff --git a/gnome-shell.changes b/gnome-shell.changes index 3c93f3e..149a839 100644 --- a/gnome-shell.changes +++ b/gnome-shell.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Oct 19 21:57:31 UTC 2017 - mgorse@suse.com + +- Add + gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch: + fixes a crash when the monitor is turned off (bgo#788607). + ------------------------------------------------------------------- Sat Oct 14 20:53:32 UTC 2017 - badshah400@gmail.com diff --git a/gnome-shell.spec b/gnome-shell.spec index aedfad4..e0ac844 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -41,6 +41,8 @@ Patch2: gnome-shell-disable-ibus-when-not-installed.patch Patch3: gnome-shell-Avoid-loginDialog-grab-focus-when-locked.patch # PATCH-FIX-UPSTREAM gnome-shell-osk-dont-popup-when-not-needed.patch bgo#788188 badshah400@gmail.com -- Stop the on-screen keyboard from showing up when touchscreen use doesn't activate a text field; patch taken from upstream bug report Patch4: gnome-shell-osk-dont-popup-when-not-needed.patch +# PATCH-FIX-UPSTREAM gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch bgo#788607 mgorse@suse.com -- unset primary and button monitor when headless; fixes a crash. +Patch5: gnome-shell-unset-primary-and-bottom-monitor-when-headless.patch ## NOTE: Keep SLE only patches at bottom (starting on 1000). # PATCH-FEATURE-SLE gnome-shell-gdm-login-applet.patch fate#314545 dliang@suse.com -- Add an applet on login UI to display suse icon, product name, hostname. @@ -190,6 +192,7 @@ into GNOME Shell calendar. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %if !0%{?is_opensuse} %patch1001 -p1