actually use the new patch
This commit is contained in:
parent
463900b99f
commit
2c35e6b1d5
@ -1,4 +1,4 @@
|
|||||||
From 4bf4e9c9dcc1e56b5a058822056d91be7d3a0a36 Mon Sep 17 00:00:00 2001
|
From a26f7c5190ebc82f9f17e0446159311377b20d3f Mon Sep 17 00:00:00 2001
|
||||||
From: Richard Hughes <richard@hughsie.com>
|
From: Richard Hughes <richard@hughsie.com>
|
||||||
Date: Fri, 21 Sep 2012 11:56:53 +0100
|
Date: Fri, 21 Sep 2012 11:56:53 +0100
|
||||||
Subject: [PATCH] power and media-keys: Use logind for suspending and
|
Subject: [PATCH] power and media-keys: Use logind for suspending and
|
||||||
@ -18,8 +18,8 @@ https://bugzilla.gnome.org/show_bug.cgi?id=680689
|
|||||||
plugins/common/gsd-power-helper.c | 203 --------
|
plugins/common/gsd-power-helper.c | 203 --------
|
||||||
plugins/common/gsd-power-helper.h | 35 --
|
plugins/common/gsd-power-helper.h | 35 --
|
||||||
plugins/media-keys/gsd-media-keys-manager.c | 156 +++++--
|
plugins/media-keys/gsd-media-keys-manager.c | 156 +++++--
|
||||||
plugins/power/gsd-power-manager.c | 691 +++++++++++++++++++---------
|
plugins/power/gsd-power-manager.c | 699 +++++++++++++++++++---------
|
||||||
5 files changed, 587 insertions(+), 502 deletions(-)
|
5 files changed, 595 insertions(+), 502 deletions(-)
|
||||||
delete mode 100644 plugins/common/gsd-power-helper.c
|
delete mode 100644 plugins/common/gsd-power-helper.c
|
||||||
delete mode 100644 plugins/common/gsd-power-helper.h
|
delete mode 100644 plugins/common/gsd-power-helper.h
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ index 9c84d7f..a2f277e 100644
|
|||||||
|
|
||||||
GsdMediaKeysManager *
|
GsdMediaKeysManager *
|
||||||
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
|
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
|
||||||
index 0e06495..a931061 100644
|
index 0e06495..7c120c4 100644
|
||||||
--- a/plugins/power/gsd-power-manager.c
|
--- a/plugins/power/gsd-power-manager.c
|
||||||
+++ b/plugins/power/gsd-power-manager.c
|
+++ b/plugins/power/gsd-power-manager.c
|
||||||
@@ -1,7 +1,7 @@
|
@@ -1,7 +1,7 @@
|
||||||
@ -584,7 +584,7 @@ index 0e06495..a931061 100644
|
|||||||
/* Keep this in sync with gnome-shell */
|
/* Keep this in sync with gnome-shell */
|
||||||
#define SCREENSAVER_FADE_TIME 10 /* seconds */
|
#define SCREENSAVER_FADE_TIME 10 /* seconds */
|
||||||
|
|
||||||
@@ -190,13 +194,17 @@ struct GsdPowerManagerPrivate
|
@@ -190,13 +194,19 @@ struct GsdPowerManagerPrivate
|
||||||
ca_context *canberra_context;
|
ca_context *canberra_context;
|
||||||
ca_proplist *critical_alert_loop_props;
|
ca_proplist *critical_alert_loop_props;
|
||||||
guint32 critical_alert_timeout_id;
|
guint32 critical_alert_timeout_id;
|
||||||
@ -599,12 +599,14 @@ index 0e06495..a931061 100644
|
|||||||
+ /* systemd stuff */
|
+ /* systemd stuff */
|
||||||
+ GDBusProxy *logind_proxy;
|
+ GDBusProxy *logind_proxy;
|
||||||
+ gint inhibit_lid_switch_fd;
|
+ gint inhibit_lid_switch_fd;
|
||||||
|
+ gboolean inhibit_lid_switch_taken;
|
||||||
+ gint inhibit_suspend_fd;
|
+ gint inhibit_suspend_fd;
|
||||||
|
+ gboolean inhibit_suspend_taken;
|
||||||
+ guint inhibit_lid_switch_timer_id;
|
+ guint inhibit_lid_switch_timer_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -213,8 +221,8 @@ static GIcon *engine_get_icon (GsdPowerManager *manager);
|
@@ -213,8 +223,8 @@ static GIcon *engine_get_icon (GsdPowerManager *manager);
|
||||||
static gchar *engine_get_summary (GsdPowerManager *manager);
|
static gchar *engine_get_summary (GsdPowerManager *manager);
|
||||||
static void do_power_action_type (GsdPowerManager *manager, GsdPowerActionType action_type);
|
static void do_power_action_type (GsdPowerManager *manager, GsdPowerActionType action_type);
|
||||||
static void do_lid_closed_action (GsdPowerManager *manager);
|
static void do_lid_closed_action (GsdPowerManager *manager);
|
||||||
@ -615,7 +617,7 @@ index 0e06495..a931061 100644
|
|||||||
|
|
||||||
G_DEFINE_TYPE (GsdPowerManager, gsd_power_manager, G_TYPE_OBJECT)
|
G_DEFINE_TYPE (GsdPowerManager, gsd_power_manager, G_TYPE_OBJECT)
|
||||||
|
|
||||||
@@ -2044,6 +2052,57 @@ gnome_session_shutdown (void)
|
@@ -2044,6 +2054,57 @@ gnome_session_shutdown (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -673,7 +675,7 @@ index 0e06495..a931061 100644
|
|||||||
do_power_action_type (GsdPowerManager *manager,
|
do_power_action_type (GsdPowerManager *manager,
|
||||||
GsdPowerActionType action_type)
|
GsdPowerActionType action_type)
|
||||||
{
|
{
|
||||||
@@ -2052,19 +2111,19 @@ do_power_action_type (GsdPowerManager *manager,
|
@@ -2052,19 +2113,19 @@ do_power_action_type (GsdPowerManager *manager,
|
||||||
|
|
||||||
switch (action_type) {
|
switch (action_type) {
|
||||||
case GSD_POWER_ACTION_SUSPEND:
|
case GSD_POWER_ACTION_SUSPEND:
|
||||||
@ -696,7 +698,7 @@ index 0e06495..a931061 100644
|
|||||||
break;
|
break;
|
||||||
case GSD_POWER_ACTION_BLANK:
|
case GSD_POWER_ACTION_BLANK:
|
||||||
ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
|
ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
|
||||||
@@ -2136,85 +2195,20 @@ upower_kbd_toggle (GsdPowerManager *manager,
|
@@ -2136,85 +2197,20 @@ upower_kbd_toggle (GsdPowerManager *manager,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,7 +794,7 @@ index 0e06495..a931061 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Sets up a timer to be triggered some seconds after closing the laptop lid
|
/* Sets up a timer to be triggered some seconds after closing the laptop lid
|
||||||
@@ -2222,82 +2216,73 @@ lid_close_safety_timer_cb (GsdPowerManager *manager)
|
@@ -2222,82 +2218,73 @@ lid_close_safety_timer_cb (GsdPowerManager *manager)
|
||||||
* again in the timeout handler to see if we can suspend then.
|
* again in the timeout handler to see if we can suspend then.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -908,7 +910,7 @@ index 0e06495..a931061 100644
|
|||||||
/* play a sound, using sounds from the naming spec */
|
/* play a sound, using sounds from the naming spec */
|
||||||
ca_context_play (manager->priv->canberra_context, 0,
|
ca_context_play (manager->priv->canberra_context, 0,
|
||||||
CA_PROP_EVENT_ID, "lid-close",
|
CA_PROP_EVENT_ID, "lid-close",
|
||||||
@@ -2305,21 +2290,22 @@ do_lid_closed_action (GsdPowerManager *manager)
|
@@ -2305,21 +2292,22 @@ do_lid_closed_action (GsdPowerManager *manager)
|
||||||
CA_PROP_EVENT_DESCRIPTION, _("Lid has been closed"),
|
CA_PROP_EVENT_DESCRIPTION, _("Lid has been closed"),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
@ -941,7 +943,7 @@ index 0e06495..a931061 100644
|
|||||||
static void
|
static void
|
||||||
up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
|
up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
|
||||||
{
|
{
|
||||||
@@ -2339,6 +2325,7 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
|
@@ -2339,6 +2327,7 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
|
||||||
if (manager->priv->lid_is_closed == tmp)
|
if (manager->priv->lid_is_closed == tmp)
|
||||||
return;
|
return;
|
||||||
manager->priv->lid_is_closed = tmp;
|
manager->priv->lid_is_closed = tmp;
|
||||||
@ -949,7 +951,7 @@ index 0e06495..a931061 100644
|
|||||||
|
|
||||||
/* fake a keypress */
|
/* fake a keypress */
|
||||||
if (tmp)
|
if (tmp)
|
||||||
@@ -3290,30 +3277,6 @@ gsd_power_manager_class_init (GsdPowerManagerClass *klass)
|
@@ -3290,30 +3279,6 @@ gsd_power_manager_class_init (GsdPowerManagerClass *klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -980,7 +982,7 @@ index 0e06495..a931061 100644
|
|||||||
idle_dbus_signal_cb (GDBusProxy *proxy,
|
idle_dbus_signal_cb (GDBusProxy *proxy,
|
||||||
const gchar *sender_name,
|
const gchar *sender_name,
|
||||||
const gchar *signal_name,
|
const gchar *signal_name,
|
||||||
@@ -3465,75 +3428,38 @@ out:
|
@@ -3465,75 +3430,38 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1080,7 +1082,7 @@ index 0e06495..a931061 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -3621,6 +3547,283 @@ engine_session_active_changed_cb (GnomeSettingsSession *session,
|
@@ -3621,6 +3549,287 @@ engine_session_active_changed_cb (GnomeSettingsSession *session,
|
||||||
idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
|
idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1118,11 +1120,12 @@ index 0e06495..a931061 100644
|
|||||||
+{
|
+{
|
||||||
+ GVariant *params;
|
+ GVariant *params;
|
||||||
+
|
+
|
||||||
+ if (manager->priv->inhibit_lid_switch_fd != -1) {
|
+ if (manager->priv->inhibit_lid_switch_taken) {
|
||||||
+ g_debug ("already inhibited lid-switch");
|
+ g_debug ("already inhibited lid-switch");
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ g_debug ("Adding lid switch system inhibitor");
|
+ g_debug ("Adding lid switch system inhibitor");
|
||||||
|
+ manager->priv->inhibit_lid_switch_taken = TRUE;
|
||||||
+
|
+
|
||||||
+ params = g_variant_new ("(ssss)",
|
+ params = g_variant_new ("(ssss)",
|
||||||
+ "handle-lid-switch",
|
+ "handle-lid-switch",
|
||||||
@ -1150,6 +1153,7 @@ index 0e06495..a931061 100644
|
|||||||
+ g_debug ("Removing lid switch system inhibitor");
|
+ g_debug ("Removing lid switch system inhibitor");
|
||||||
+ close (manager->priv->inhibit_lid_switch_fd);
|
+ close (manager->priv->inhibit_lid_switch_fd);
|
||||||
+ manager->priv->inhibit_lid_switch_fd = -1;
|
+ manager->priv->inhibit_lid_switch_fd = -1;
|
||||||
|
+ manager->priv->inhibit_lid_switch_taken = FALSE;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static void
|
+static void
|
||||||
@ -1188,11 +1192,12 @@ index 0e06495..a931061 100644
|
|||||||
+static void
|
+static void
|
||||||
+inhibit_suspend (GsdPowerManager *manager)
|
+inhibit_suspend (GsdPowerManager *manager)
|
||||||
+{
|
+{
|
||||||
+ if (manager->priv->inhibit_suspend_fd != -1) {
|
+ if (manager->priv->inhibit_suspend_taken) {
|
||||||
+ g_debug ("already inhibited lid-switch");
|
+ g_debug ("already inhibited lid-switch");
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ g_debug ("Adding suspend delay inhibitor");
|
+ g_debug ("Adding suspend delay inhibitor");
|
||||||
|
+ manager->priv->inhibit_suspend_taken = TRUE;
|
||||||
+ g_dbus_proxy_call_with_unix_fd_list (manager->priv->logind_proxy,
|
+ g_dbus_proxy_call_with_unix_fd_list (manager->priv->logind_proxy,
|
||||||
+ "Inhibit",
|
+ "Inhibit",
|
||||||
+ g_variant_new ("(ssss)",
|
+ g_variant_new ("(ssss)",
|
||||||
@ -1218,6 +1223,7 @@ index 0e06495..a931061 100644
|
|||||||
+ g_debug ("Removing suspend delay inhibitor");
|
+ g_debug ("Removing suspend delay inhibitor");
|
||||||
+ close (manager->priv->inhibit_suspend_fd);
|
+ close (manager->priv->inhibit_suspend_fd);
|
||||||
+ manager->priv->inhibit_suspend_fd = -1;
|
+ manager->priv->inhibit_suspend_fd = -1;
|
||||||
|
+ manager->priv->inhibit_suspend_taken = TRUE;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static gboolean
|
+static gboolean
|
||||||
@ -1364,7 +1370,7 @@ index 0e06495..a931061 100644
|
|||||||
gboolean
|
gboolean
|
||||||
gsd_power_manager_start (GsdPowerManager *manager,
|
gsd_power_manager_start (GsdPowerManager *manager,
|
||||||
GError **error)
|
GError **error)
|
||||||
@@ -3630,6 +3833,25 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
@@ -3630,6 +3839,25 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
||||||
g_debug ("Starting power manager");
|
g_debug ("Starting power manager");
|
||||||
gnome_settings_profile_start (NULL);
|
gnome_settings_profile_start (NULL);
|
||||||
|
|
||||||
@ -1390,7 +1396,7 @@ index 0e06495..a931061 100644
|
|||||||
/* track the active session */
|
/* track the active session */
|
||||||
manager->priv->session = gnome_settings_session_new ();
|
manager->priv->session = gnome_settings_session_new ();
|
||||||
g_signal_connect (manager->priv->session, "notify::state",
|
g_signal_connect (manager->priv->session, "notify::state",
|
||||||
@@ -3644,10 +3866,6 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
@@ -3644,10 +3872,6 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
||||||
G_CALLBACK (engine_settings_key_changed_cb), manager);
|
G_CALLBACK (engine_settings_key_changed_cb), manager);
|
||||||
manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
|
manager->priv->settings_screensaver = g_settings_new ("org.gnome.desktop.screensaver");
|
||||||
manager->priv->up_client = up_client_new ();
|
manager->priv->up_client = up_client_new ();
|
||||||
@ -1401,7 +1407,7 @@ index 0e06495..a931061 100644
|
|||||||
manager->priv->lid_is_closed = up_client_get_lid_is_closed (manager->priv->up_client);
|
manager->priv->lid_is_closed = up_client_get_lid_is_closed (manager->priv->up_client);
|
||||||
g_signal_connect (manager->priv->up_client, "device-added",
|
g_signal_connect (manager->priv->up_client, "device-added",
|
||||||
G_CALLBACK (engine_device_added_cb), manager);
|
G_CALLBACK (engine_device_added_cb), manager);
|
||||||
@@ -3761,6 +3979,9 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
@@ -3761,6 +3985,9 @@ gsd_power_manager_start (GsdPowerManager *manager,
|
||||||
manager->priv->x11_screen = gnome_rr_screen_new (gdk_screen_get_default (), error);
|
manager->priv->x11_screen = gnome_rr_screen_new (gdk_screen_get_default (), error);
|
||||||
if (manager->priv->x11_screen == NULL)
|
if (manager->priv->x11_screen == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1411,7 +1417,7 @@ index 0e06495..a931061 100644
|
|||||||
|
|
||||||
/* ensure the default dpms timeouts are cleared */
|
/* ensure the default dpms timeouts are cleared */
|
||||||
ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
|
ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
|
||||||
@@ -3787,6 +4008,11 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
@@ -3787,6 +4014,11 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
||||||
{
|
{
|
||||||
g_debug ("Stopping power manager");
|
g_debug ("Stopping power manager");
|
||||||
|
|
||||||
@ -1423,7 +1429,7 @@ index 0e06495..a931061 100644
|
|||||||
if (manager->priv->bus_cancellable != NULL) {
|
if (manager->priv->bus_cancellable != NULL) {
|
||||||
g_cancellable_cancel (manager->priv->bus_cancellable);
|
g_cancellable_cancel (manager->priv->bus_cancellable);
|
||||||
g_object_unref (manager->priv->bus_cancellable);
|
g_object_unref (manager->priv->bus_cancellable);
|
||||||
@@ -3798,8 +4024,6 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
@@ -3798,8 +4030,6 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
||||||
manager->priv->introspection_data = NULL;
|
manager->priv->introspection_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1432,7 +1438,7 @@ index 0e06495..a931061 100644
|
|||||||
g_signal_handlers_disconnect_by_data (manager->priv->up_client, manager);
|
g_signal_handlers_disconnect_by_data (manager->priv->up_client, manager);
|
||||||
|
|
||||||
g_clear_object (&manager->priv->connection);
|
g_clear_object (&manager->priv->connection);
|
||||||
@@ -3807,6 +4031,17 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
@@ -3807,6 +4037,19 @@ gsd_power_manager_stop (GsdPowerManager *manager)
|
||||||
g_clear_object (&manager->priv->settings);
|
g_clear_object (&manager->priv->settings);
|
||||||
g_clear_object (&manager->priv->settings_screensaver);
|
g_clear_object (&manager->priv->settings_screensaver);
|
||||||
g_clear_object (&manager->priv->up_client);
|
g_clear_object (&manager->priv->up_client);
|
||||||
@ -1440,17 +1446,19 @@ index 0e06495..a931061 100644
|
|||||||
+ if (manager->priv->inhibit_lid_switch_fd != -1) {
|
+ if (manager->priv->inhibit_lid_switch_fd != -1) {
|
||||||
+ close (manager->priv->inhibit_lid_switch_fd);
|
+ close (manager->priv->inhibit_lid_switch_fd);
|
||||||
+ manager->priv->inhibit_lid_switch_fd = -1;
|
+ manager->priv->inhibit_lid_switch_fd = -1;
|
||||||
|
+ manager->priv->inhibit_lid_switch_taken = FALSE;
|
||||||
+ }
|
+ }
|
||||||
+ if (manager->priv->inhibit_suspend_fd != -1) {
|
+ if (manager->priv->inhibit_suspend_fd != -1) {
|
||||||
+ close (manager->priv->inhibit_suspend_fd);
|
+ close (manager->priv->inhibit_suspend_fd);
|
||||||
+ manager->priv->inhibit_suspend_fd = -1;
|
+ manager->priv->inhibit_suspend_fd = -1;
|
||||||
|
+ manager->priv->inhibit_suspend_taken = FALSE;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ g_clear_object (&manager->priv->logind_proxy);
|
+ g_clear_object (&manager->priv->logind_proxy);
|
||||||
g_clear_object (&manager->priv->x11_screen);
|
g_clear_object (&manager->priv->x11_screen);
|
||||||
|
|
||||||
g_ptr_array_unref (manager->priv->devices_array);
|
g_ptr_array_unref (manager->priv->devices_array);
|
||||||
@@ -3835,6 +4070,8 @@ static void
|
@@ -3835,6 +4078,8 @@ static void
|
||||||
gsd_power_manager_init (GsdPowerManager *manager)
|
gsd_power_manager_init (GsdPowerManager *manager)
|
||||||
{
|
{
|
||||||
manager->priv = GSD_POWER_MANAGER_GET_PRIVATE (manager);
|
manager->priv = GSD_POWER_MANAGER_GET_PRIVATE (manager);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name: gnome-settings-daemon
|
Name: gnome-settings-daemon
|
||||||
Version: 3.6.0
|
Version: 3.6.0
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
|
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -257,7 +257,7 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
|
|||||||
%{_datadir}/dbus-1/interfaces/org.gnome.SettingsDaemonUpdates.xml
|
%{_datadir}/dbus-1/interfaces/org.gnome.SettingsDaemonUpdates.xml
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Oct 3 2012 Matthias Clasen <mclasen@redhat.com> - 3.6.0-4
|
* Wed Oct 3 2012 Matthias Clasen <mclasen@redhat.com> - 3.6.0-5
|
||||||
- Fix an inhibitor leak in the previous patch
|
- Fix an inhibitor leak in the previous patch
|
||||||
|
|
||||||
* Tue Oct 2 2012 Matthias Clasen <mclasen@redhat.com> - 3.6.0-3
|
* Tue Oct 2 2012 Matthias Clasen <mclasen@redhat.com> - 3.6.0-3
|
||||||
|
Loading…
Reference in New Issue
Block a user