diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h index a7a0671ae..9a59b99c9 100644 --- a/src/backends/meta-monitor-manager-private.h +++ b/src/backends/meta-monitor-manager-private.h @@ -181,6 +181,7 @@ struct _MetaMonitorManager GnomePnpIds *pnp_ids; UpClient *up_client; + gboolean lid_is_closed; gulong experimental_features_changed_handler_id; diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index edfa1f64d..ec186009b 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -351,7 +351,13 @@ lid_is_closed_changed (UpClient *client, gpointer user_data) { MetaMonitorManager *manager = user_data; + gboolean lid_is_closed; + lid_is_closed = up_client_get_lid_is_closed (manager->up_client); + if (lid_is_closed == manager->lid_is_closed) + return; + + manager->lid_is_closed = lid_is_closed; meta_monitor_manager_lid_is_closed_changed (manager); } @@ -361,7 +367,7 @@ meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager) if (!manager->up_client) return FALSE; - return up_client_get_lid_is_closed (manager->up_client); + return manager->lid_is_closed; } gboolean @@ -737,6 +743,7 @@ meta_monitor_manager_constructed (GObject *object) { g_signal_connect_object (manager->up_client, "notify::lid-is-closed", G_CALLBACK (lid_is_closed_changed), manager, 0); + manager->lid_is_closed = up_client_get_lid_is_closed (manager->up_client); } }