diff -Nru mutter-3.10.4/debian/changelog mutter-3.10.4/debian/changelog --- mutter-3.10.4/debian/changelog 2014-03-18 21:17:48.000000000 +0000 +++ mutter-3.10.4/debian/changelog 2014-05-16 21:53:13.000000000 +0000 @@ -1,3 +1,10 @@ +mutter (3.10.4-0ubuntu2.1) trusty; urgency=medium + + * debian/patches/git-fix-crash-on-hotplug-*.patch: + - Backport crasher fix from upstream git (LP: #1319897, BGO#725637) + + -- Marius Gedminas Fri, 16 May 2014 18:08:32 +0300 + mutter (3.10.4-0ubuntu2) trusty; urgency=medium * debian/patches/git_ignore_error_when_settings_primary.patch (LP: #1288572) diff -Nru mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-001.patch mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-001.patch --- mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-001.patch 1970-01-01 00:00:00.000000000 +0000 +++ mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-001.patch 2014-05-16 21:51:43.000000000 +0000 @@ -0,0 +1,53 @@ +From aa3079b914df5e04eb5290ed25b71ddab7e62b77 Mon Sep 17 00:00:00 2001 +From: Giovanni Campagna +Date: Tue, 6 May 2014 19:51:13 +0200 +Subject: [PATCH] MetaMonitorConfig: don't keep a previous config with the + wrong outputs + +We can only apply a configuration if its outputs match the connected +ones, so discard the current configuration if the set of output changes +(for example for hotplug), otherwise we will crash trying to apply +the bogus previous configuration. + +https://bugzilla.gnome.org/show_bug.cgi?id=725637 +--- + src/core/monitor-config.c | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/src/core/monitor-config.c b/src/core/monitor-config.c +index a232ff4..035dcee 100644 +--- a/src/core/monitor-config.c ++++ b/src/core/monitor-config.c +@@ -877,7 +877,8 @@ apply_configuration (MetaMonitorConfig *self, + + /* Stored (persistent) configurations override the previous one always. + Also, we clear the previous configuration if the current one (which is +- about to become previous) is stored. ++ about to become previous) is stored, of if the current one has a ++ different outputs. + */ + if (stored || + (self->current && self->current_is_stored)) +@@ -888,7 +889,19 @@ apply_configuration (MetaMonitorConfig *self, + } + else + { +- self->previous = self->current; ++ /* Despite the name, config_equal() only checks the set of outputs, ++ not their modes ++ */ ++ if (self->current && config_equal (self->current, config)) ++ { ++ self->previous = self->current; ++ } ++ else ++ { ++ if (self->current) ++ config_free (self->current); ++ self->previous = NULL; ++ } + } + + self->current = config; +-- +1.9.0 diff -Nru mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-002.patch mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-002.patch --- mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-002.patch 1970-01-01 00:00:00.000000000 +0000 +++ mutter-3.10.4/debian/patches/git-fix-crash-on-hotplug-002.patch 2014-05-16 21:51:43.000000000 +0000 @@ -0,0 +1,72 @@ +From fbd7408f0ef429893ddf4d81edd63ce383d1287a Mon Sep 17 00:00:00 2001 +From: Giovanni Campagna +Date: Tue, 6 May 2014 19:59:16 +0200 +Subject: [PATCH] MetaMonitorConfig: don't always restore the previous config + when opening the laptop lid + +Only do it if the current configuration was actually created +as the result of closing the laptop lid. + +https://bugzilla.gnome.org/show_bug.cgi?id=725637 +--- + src/core/monitor-config.c | 16 ++++++++++++++-- + 1 file changed, 14 insertions(+), 2 deletions(-) + +diff --git a/src/core/monitor-config.c b/src/core/monitor-config.c +index 035dcee..8b56b0a 100644 +--- a/src/core/monitor-config.c ++++ b/src/core/monitor-config.c +@@ -78,6 +78,7 @@ struct _MetaMonitorConfig { + GHashTable *configs; + MetaConfiguration *current; + gboolean current_is_stored; ++ gboolean current_is_for_laptop_lid; + MetaConfiguration *previous; + + GFile *file; +@@ -906,6 +907,10 @@ apply_configuration (MetaMonitorConfig *self, + + self->current = config; + self->current_is_stored = stored; ++ /* If true, we'll be overridden at the end of this call ++ inside turn_off_laptop_display() ++ */ ++ self->current_is_for_laptop_lid = FALSE; + + if (self->current == self->previous) + self->previous = NULL; +@@ -1022,8 +1027,14 @@ meta_monitor_config_apply_stored (MetaMonitorConfig *self, + if (self->lid_is_closed && + stored->n_outputs > 1 && + laptop_display_is_on (stored)) +- return apply_configuration (self, make_laptop_lid_config (stored), ++ { ++ gboolean ok; ++ ++ ok = apply_configuration (self, make_laptop_lid_config (stored), + manager, FALSE); ++ self->current_is_for_laptop_lid = TRUE; ++ return ok; ++ } + else + return apply_configuration (self, stored, manager, TRUE); + } +@@ -1370,6 +1381,7 @@ turn_off_laptop_display (MetaMonitorConfig *self, + + new = make_laptop_lid_config (self->current); + apply_configuration (self, new, manager, FALSE); ++ self->current_is_for_laptop_lid = TRUE; + } + + static void +@@ -1389,7 +1401,7 @@ power_client_changed_cb (UpClient *client, + + if (is_closed) + turn_off_laptop_display (self, manager); +- else ++ else if (self->current_is_for_laptop_lid) + meta_monitor_config_restore_previous (self, manager); + } + } +-- +1.9.0 diff -Nru mutter-3.10.4/debian/patches/series mutter-3.10.4/debian/patches/series --- mutter-3.10.4/debian/patches/series 2014-03-18 21:14:54.000000000 +0000 +++ mutter-3.10.4/debian/patches/series 2014-05-16 21:52:11.000000000 +0000 @@ -1,3 +1,5 @@ 01_Wcast-align.patch 04_ignore_shadow_and_padding.patch git_ignore_error_when_settings_primary.patch +git-fix-crash-on-hotplug-001.patch +git-fix-crash-on-hotplug-002.patch