Accepting request 149460 from home:dimstar:branches:GNOME:Factory

Integrate some wanted patches...

OBS-URL: https://build.opensuse.org/request/show/149460
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=153
This commit is contained in:
Dominique Leuenberger 2013-01-21 16:38:42 +00:00 committed by Git OBS Bridge
parent db7d36ac90
commit 37f747727c
4 changed files with 1605 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,115 @@
Index: gnome-settings-daemon-3.6.3/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in.in
===================================================================
--- gnome-settings-daemon-3.6.3.orig/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in.in
+++ gnome-settings-daemon-3.6.3/data/org.gnome.settings-daemon.plugins.power.gschema.xml.in.in
@@ -148,5 +148,10 @@
<_summary>If we should show the recalled battery warning for a broken battery</_summary>
<_description>If we should show the recalled battery warning for a broken battery. Set this to false only if you know your battery is okay.</_description>
</key>
+ <key name="notify-idle-resumed" type="b">
+ <default>true</default>
+ <_summary>If an information message should be displayed when returning from idle sleep.</_summary>
+ <_description>If an information message should be displayed when returning from idle sleep.</_description>
+ </key>
</schema>
</schemalist>
Index: gnome-settings-daemon-3.6.3/plugins/power/gsd-power-manager.c
===================================================================
--- gnome-settings-daemon-3.6.3.orig/plugins/power/gsd-power-manager.c
+++ gnome-settings-daemon-3.6.3/plugins/power/gsd-power-manager.c
@@ -194,6 +194,7 @@ struct GsdPowerManagerPrivate
UpDevice *device_composite;
NotifyNotification *notification_discharging;
NotifyNotification *notification_low;
+ NotifyNotification *notification_resumed;
ca_context *canberra_context;
ca_proplist *critical_alert_loop_props;
guint32 critical_alert_timeout_id;
@@ -204,6 +205,7 @@ struct GsdPowerManagerPrivate
GtkStatusIcon *status_icon;
guint xscreensaver_watchdog_timer_id;
gboolean is_virtual_machine;
+ GsdPowerActionType last_idle_power_action;
/* systemd stuff */
GDBusProxy *logind_proxy;
@@ -2909,6 +2911,49 @@ kbd_backlight_dim (GsdPowerManager *mana
}
static void
+show_resumed_notification (GsdPowerManager *manager)
+{
+ GError *error = NULL;
+ gboolean ret;
+
+ /* don't show when running under GDM */
+ if (g_getenv ("RUNNING_UNDER_GDM") != NULL) {
+ g_debug ("running under gdm, so no notification");
+ return;
+ }
+
+ ret = g_settings_get_boolean (manager->priv->settings, "notify-idle-resumed");
+ if (!ret)
+ return;
+
+ /* close any existing notification of this class */
+ notify_close_if_showing (manager->priv->notification_resumed);
+
+ /* create a new notification */
+ create_notification (_("System resumed from sleep"),
+ _("The system automatically went to sleep because the system was idle."),
+ NULL,
+ &manager->priv->notification_resumed);
+ notify_notification_set_timeout (manager->priv->notification_resumed,
+ GSD_POWER_MANAGER_NOTIFY_TIMEOUT_SHORT);
+ notify_notification_set_urgency (manager->priv->notification_resumed,
+ NOTIFY_URGENCY_NORMAL);
+ /* TRANSLATORS: this is the notification application name */
+ notify_notification_set_app_name (manager->priv->notification_resumed, _("Power"));
+ notify_notification_set_hint (manager->priv->notification_resumed,
+ "transient", g_variant_new_boolean (TRUE));
+
+ /* try to show */
+ ret = notify_notification_show (manager->priv->notification_resumed,
+ &error);
+ if (!ret) {
+ g_warning ("failed to show notification: %s", error->message);
+ g_error_free (error);
+ g_object_unref (manager->priv->notification_resumed);
+ }
+}
+
+static void
idle_set_mode (GsdPowerManager *manager, GsdPowerIdleMode mode)
{
gboolean ret = FALSE;
@@ -3012,6 +3057,8 @@ idle_set_mode (GsdPowerManager *manager,
action_type = g_settings_get_enum (manager->priv->settings,
"sleep-inactive-ac-type");
}
+
+ manager->priv->last_idle_power_action = action_type;
do_power_action_type (manager, action_type);
/* turn on screen and restore user-selected brightness level */
@@ -3066,7 +3113,6 @@ idle_set_mode (GsdPowerManager *manager,
}
manager->priv->kbd_brightness_pre_dim = -1;
}
-
}
}
@@ -3932,6 +3978,12 @@ handle_resume_actions (GsdPowerManager *
notify_close_if_showing (manager->priv->notification_low);
notify_close_if_showing (manager->priv->notification_discharging);
+ if (manager->priv->last_idle_power_action == GSD_POWER_ACTION_SUSPEND ||
+ manager->priv->last_idle_power_action == GSD_POWER_ACTION_HIBERNATE)
+ show_resumed_notification (manager);
+
+ manager->priv->last_idle_power_action = GSD_POWER_ACTION_NOTHING;
+
/* ensure we turn the panel back on after resume */
ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
GNOME_RR_DPMS_ON,

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Sun Jan 20 11:38:01 UTC 2013 - dimstar@opensuse.org
- Add gnome-settings-daemon-double-suspend.patch: Fix double
suspend: if GNOME is configured to suspend on lid close, the
system goes directly back in sleep upon a wakeup call. Only the
2nd wake up is successful and persistent. This issue comes from
systemd and gnome both executing suspend.
-------------------------------------------------------------------
Sun Jan 13 18:48:52 UTC 2013 - zaitor@opensuse.org
- Add gnome-settings-daemon-notify-idle-resumed.patch, notify user
about auto suspend when returning from sleep (bnc#708182).
-------------------------------------------------------------------
Thu Nov 15 19:23:14 UTC 2012 - dimstar@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package gnome-settings-daemon
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -45,6 +45,10 @@ Patch14: gnome-packagekit-fate302445.patch
Patch15: gnome-packagekit-BNC383261.patch
# PATCH-FIX-OPENSUSE gnome-settings-daemon-stop-reload-proxy-settings.patch bnc689592#c1, bnc#538353 glin@suse.com -- Stop g-s-d poping up the authentication dialog for reloading the proxy settings
Patch17: gnome-settings-daemon-stop-reload-proxy-settings.patch
# PATCH-FIX-UPSTREAM gnome-settings-daemon-double-suspend.patch bgo#680689 dimstar@opensuse.org -- Fix system suspending againt after waking up (fight with systemd)
Patch18: gnome-settings-daemon-double-suspend.patch
# PATCH-FEATURE-UPSTREAM gnome-settings-daemon-notify-idle-resumed.patch bnc#439018 bnc#708182 bgo575467 hpj@suse.com -- notify user about auto suspend when returning from sleep
Patch19: gnome-settings-daemon-notify-idle-resumed.patch
BuildRequires: cups-devel
BuildRequires: fdupes
BuildRequires: gnome-common
@ -140,6 +144,8 @@ translation-update-upstream
# PATCH-NEEDS-REBASE
#%%patch15 -p0
%patch17 -p1
%patch18 -p1
%patch19 -p1
%endif
%if 0%{?BUILD_FROM_VCS}