[mutter] monitor-manager: Don't try to match the outputs on hotplug



commit b3821c4f90bc7ff92fab02bf74b30464513ce2a0
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Oct 16 11:13:47 2014 +0200

    monitor-manager: Don't try to match the outputs on hotplug
    
    meta_monitor_config_match_current() only matches the number of outputs
    and if the output connector, vendor, product and serial match.
    
    In the X backend, this means that we can't use it to bypass doing any
    work because it won't detect cases where we actually want to update
    ourselves like e.g. an output being turned off either by us or by
    another X client (e.g. xrandr).
    
    In the native backend, unlike the xrandr backend, we only get called
    on real hotplug events and thus should always trigger the common
    hotplug code to (possibly) apply a new mode so the check is pointless
    anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738630

 src/backends/meta-monitor-config.c             |   21 ---------------------
 src/backends/meta-monitor-config.h             |    3 ---
 src/backends/native/meta-monitor-manager-kms.c |    6 ------
 src/backends/x11/meta-monitor-manager-xrandr.c |    4 ----
 4 files changed, 0 insertions(+), 34 deletions(-)
---
diff --git a/src/backends/meta-monitor-config.c b/src/backends/meta-monitor-config.c
index c97505d..1aa85b7 100644
--- a/src/backends/meta-monitor-config.c
+++ b/src/backends/meta-monitor-config.c
@@ -797,27 +797,6 @@ make_config_key (MetaConfiguration *key,
 }
 
 gboolean
-meta_monitor_config_match_current (MetaMonitorConfig  *self,
-                                   MetaMonitorManager *manager)
-{
-  MetaOutput *outputs;
-  unsigned n_outputs;
-  MetaConfiguration key;
-  gboolean ok;
-
-  if (self->current == NULL)
-    return FALSE;
-
-  outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
-
-  make_config_key (&key, outputs, n_outputs, -1);
-  ok = config_equal (&key, self->current);
-
-  config_clear (&key);
-  return ok;
-}
-
-gboolean
 meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager)
 {
   MetaOutput *outputs;
diff --git a/src/backends/meta-monitor-config.h b/src/backends/meta-monitor-config.h
index 8401569..5599b6a 100644
--- a/src/backends/meta-monitor-config.h
+++ b/src/backends/meta-monitor-config.h
@@ -36,9 +36,6 @@ GType meta_monitor_config_get_type (void) G_GNUC_CONST;
 
 MetaMonitorConfig *meta_monitor_config_new (void);
 
-gboolean           meta_monitor_config_match_current (MetaMonitorConfig  *config,
-                                                      MetaMonitorManager *manager);
-
 gboolean           meta_monitor_config_apply_stored (MetaMonitorConfig  *config,
                                                      MetaMonitorManager *manager);
 
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index 4ee2681..6334487 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -912,12 +912,6 @@ on_uevent (GUdevClient *client,
 
   meta_monitor_manager_read_current_config (manager);
 
-  /* If this config matches our existing one, don't bother doing anything. */
-  if (meta_monitor_config_match_current (manager->config, manager))
-    return;
-
-  /* This is a hotplug event, so try to make a configuration for our new
-   * set of outputs. */
   meta_monitor_manager_on_hotplug (manager);
 }
 
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index 130cb6d..4f2590e 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -1069,10 +1069,6 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
 
   meta_monitor_manager_read_current_config (manager);
 
-  /* If this config matches our existing one, don't bother doing anything. */
-  if (meta_monitor_config_match_current (manager->config, manager))
-    return TRUE;
-
   hotplug = manager_xrandr->resources->timestamp < manager_xrandr->resources->configTimestamp;
   if (hotplug)
     {


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