[mutter] Revert "monitor-manager: Remove needless code"



commit b63413e5b0a41110cf499052802943b5a18572a8
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Oct 23 16:31:09 2014 +0200

    Revert "monitor-manager: Remove needless code"
    
    It turns out that this was wrong because MetaWindow->monitor points to
    the old monitor infos and they are needed to position windows in the
    new configuration which happens in a monitors-changed handler.
    
    This reverts commit e1704acda4688074a0a7fd31005a96a28a551c1c.

 src/backends/meta-monitor-manager.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 856da7f..59c7154 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -149,8 +149,6 @@ make_logical_config (MetaMonitorManager *manager)
         manager->primary_monitor_index = info->number;
     }
 
-  g_free (manager->monitor_infos);
-
   manager->n_monitor_infos = monitor_infos->len;
   manager->monitor_infos = (void*)g_array_free (monitor_infos, FALSE);
 }
@@ -1167,12 +1165,18 @@ meta_monitor_manager_read_current_config (MetaMonitorManager *manager)
 void
 meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager)
 {
+  MetaMonitorInfo *old_monitor_infos;
+
+  old_monitor_infos = manager->monitor_infos;
+
   if (manager->in_init)
     return;
 
   make_logical_config (manager);
 
   g_signal_emit_by_name (manager, "monitors-changed");
+
+  g_free (old_monitor_infos);
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]