1
0

Accepting request 211905 from openSUSE:Factory:Staging:upower

- Add gnome-settings-daemon-upower-backport.patch -- from upstream;
  support upower 0.99.
- Up upower-glib dependency.

OBS-URL: https://build.opensuse.org/request/show/211905
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-settings-daemon?expand=0&rev=188
This commit is contained in:
Dominique Leuenberger 2013-12-23 17:51:21 +00:00 committed by Git OBS Bridge
parent 1b16847290
commit 079fb291c6
3 changed files with 87 additions and 1 deletions

View File

@ -0,0 +1,76 @@
From: Mike Gorse <mgorse@suse.com>
Date: Tue Dec 10 14:36:49 CST 2013
Subject: [PATCH] Support new libupower-glib API
Support upower 0.99. Based on commits 88de07 and 3ebfd1 from upstream.
---
plugins/power/gsd-power-manager.c | 6 +++---
diff -ur gnome-settings-daemon-3.10.2.orig/plugins/power/gsd-power-manager.c gnome-settings-daemon-3.10.2/plugins/power/gsd-power-manager.c
--- gnome-settings-daemon-3.10.2.orig/plugins/power/gsd-power-manager.c 2013-11-12 12:33:05.000000000 -0600
+++ gnome-settings-daemon-3.10.2/plugins/power/gsd-power-manager.c 2013-12-10 14:21:08.857851976 -0600
@@ -991,16 +991,6 @@
guint i;
GPtrArray *array = NULL;
UpDevice *device;
- gboolean ret;
- GError *error = NULL;
-
- /* get devices from UPower */
- ret = up_client_enumerate_devices_sync (manager->priv->up_client, NULL, &error);
- if (!ret) {
- g_warning ("failed to get device list: %s", error->message);
- g_error_free (error);
- return FALSE;
- }
engine_recalculate_state (manager);
@@ -1031,13 +1021,22 @@
}
static void
-engine_device_removed_cb (UpClient *client, UpDevice *device, GsdPowerManager *manager)
+engine_device_removed_cb (UpClient *client, const char *object_path, GsdPowerManager *manager)
{
- gboolean ret;
- ret = g_ptr_array_remove (manager->priv->devices_array, device);
- if (!ret)
- return;
- engine_recalculate_state (manager);
+ gboolean ret = FALSE;
+ guint i;
+
+ for (i = 0; i < manager->priv->devices_array->len; i++) {
+ UpDevice *device = g_ptr_array_index (manager->priv->devices_array, i);
+
+ if (g_strcmp0 (object_path, up_device_get_object_path (device)) == 0) {
+ g_ptr_array_remove_index (manager->priv->devices_array, i);
+ ret = TRUE;
+ break;
+ }
+ }
+ if (ret)
+ engine_recalculate_state (manager);
}
static void
@@ -2172,7 +2172,7 @@
}
static void
-up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
+lid_state_changed_cb (UpClient *client, GParamSpec *pspec, GsdPowerManager *manager)
{
gboolean tmp;
@@ -3276,8 +3276,8 @@
G_CALLBACK (engine_device_removed_cb), manager);
g_signal_connect (manager->priv->up_client, "device-changed",
G_CALLBACK (engine_device_changed_cb), manager);
- g_signal_connect_after (manager->priv->up_client, "changed",
- G_CALLBACK (up_client_changed_cb), manager);
+ g_signal_connect_after (manager->priv->up_client, "notify::lid-is-closed",
+ G_CALLBACK (lid_state_changed_cb), manager);
g_signal_connect (manager->priv->up_client, "notify::on-battery",
G_CALLBACK (up_client_on_battery_cb), manager);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Dec 20 00:16:59 UTC 2013 - mgorse@suse.com
- Add gnome-settings-daemon-upower-backport.patch -- from upstream;
support upower 0.99.
- Up upower-glib dependency.
-------------------------------------------------------------------
Sat Dec 14 21:42:59 UTC 2013 - zaitor@opensuse.org

View File

@ -51,6 +51,8 @@ Patch17: gnome-settings-daemon-stop-reload-proxy-settings.patch
Patch19: gnome-settings-daemon-notify-idle-resumed.patch
# PATCH-FIX-UPSTREAM gnome-settings-daemon-export-Gtk_ShellShowsDesktop-setting.patch bgo#712302 zaitor@opensuse.org -- Stop showing desktopfolder in nautilus sidebar when using gnome-shell.
Patch20: gnome-settings-daemon-export-Gtk_ShellShowsDesktop-setting.patch
# PATCH-FEATURE-UPSTREAM gnome-settings-daemon-upower-backport.patch mgorse@suse.com -- Update for libupower-glib API changes.
Patch21: gnome-settings-daemon-upower-backport.patch
BuildRequires: cups-devel
BuildRequires: fdupes
BuildRequires: gnome-common
@ -94,7 +96,7 @@ BuildRequires: pkgconfig(nss)
BuildRequires: pkgconfig(packagekit-glib2) >= 0.8.1
BuildRequires: pkgconfig(pango) >= 1.20.0
BuildRequires: pkgconfig(polkit-gobject-1) >= 0.103
BuildRequires: pkgconfig(upower-glib) >= 0.9.11
BuildRequires: pkgconfig(upower-glib) >= 0.99.0
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xfixes)
@ -145,6 +147,7 @@ translation-update-upstream
%patch17 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%build
autoreconf -f -i