[gnome-settings-daemon/gnome-3-8] power: Force updating screen config when output is disconnected
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/gnome-3-8] power: Force updating screen config when output is disconnected
- Date: Mon, 28 Apr 2014 17:10:29 +0000 (UTC)
commit 2af30cc9ab334aaf151c28f412c7068a79ff5a83
Author: Bastien Nocera <hadess hadess net>
Date: Fri Apr 25 09:16:40 2014 +0200
power: Force updating screen config when output is disconnected
When an output is disconnected, it's possible that the XRandR
configuration doesn't actually change, and thus doesn't emit
the "changed" signal. To work-around that, also capture the
output-connected and output-disconnected signals and go through
a forced refresh.
https://bugzilla.redhat.com/show_bug.cgi?id=1081093
plugins/power/gsd-power-manager.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 645df66..47bf63a 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -3325,6 +3325,13 @@ on_randr_event (GnomeRRScreen *screen, gpointer user_data)
setup_inhibit_lid_switch_timer (manager);
}
+static void
+on_randr_connection_event (GnomeRRScreen *screen, GnomeRROutput *output, gpointer user_data)
+{
+ gnome_rr_screen_refresh (screen, NULL);
+ on_randr_event (screen, user_data);
+}
+
#ifdef GSD_MOCK
static gboolean
received_sigusr2 (GsdPowerManager *manager)
@@ -3519,6 +3526,8 @@ gsd_power_manager_start (GsdPowerManager *manager,
/* set up the screens */
g_signal_connect (manager->priv->rr_screen, "changed", G_CALLBACK (on_randr_event), manager);
+ g_signal_connect (manager->priv->rr_screen, "output-connected", G_CALLBACK
(on_randr_connection_event), manager);
+ g_signal_connect (manager->priv->rr_screen, "output-disconnected", G_CALLBACK
(on_randr_connection_event), manager);
on_randr_event (manager->priv->rr_screen, manager);
#ifdef GSD_MOCK
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]