diff -Nru upower-0.9.8/debian/changelog upower-0.9.8/debian/changelog --- upower-0.9.8/debian/changelog 2011-02-23 08:46:55.000000000 -0800 +++ upower-0.9.8/debian/changelog 2011-04-13 19:44:00.000000000 -0700 @@ -1,3 +1,13 @@ +upower (0.9.8-3ubuntu1) natty; urgency=low + + * Add 100_upower_conf.patch: Add an option for polling dock devices, + which defaults to false. Polling can cause 30-sec black screen + flickering on some hardware; this change prevents that from + happening. Cherrypick from 0.9.9 release. + (LP: #727979) + + -- Bryce Harrington Wed, 13 Apr 2011 19:41:16 -0700 + upower (0.9.8-3) experimental; urgency=low [ Frédéric Péters ] diff -Nru upower-0.9.8/debian/control upower-0.9.8/debian/control --- upower-0.9.8/debian/control 2011-02-23 08:46:55.000000000 -0800 +++ upower-0.9.8/debian/control 2011-04-13 19:44:13.000000000 -0700 @@ -1,7 +1,8 @@ Source: upower Section: admin Priority: optional -Maintainer: Utopia Maintenance Team +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Utopia Maintenance Team Uploaders: Michael Biebl , Martin Pitt Build-Depends: debhelper (>= 8), autotools-dev, @@ -88,4 +89,3 @@ . It can be used by packages using the GIRepository format to generate dynamic bindings. - diff -Nru upower-0.9.8/debian/patches/100_upower_conf.patch upower-0.9.8/debian/patches/100_upower_conf.patch --- upower-0.9.8/debian/patches/100_upower_conf.patch 1969-12-31 16:00:00.000000000 -0800 +++ upower-0.9.8/debian/patches/100_upower_conf.patch 2011-04-13 19:40:31.000000000 -0700 @@ -0,0 +1,137 @@ +From 38199e44ff1e87b586d51d30b69d1f70e40d27f1 Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Thu, 03 Mar 2011 14:02:27 +0000 +Subject: Add an option for polling dock devices in UPower.conf, defaulting to false + +--- +diff --git a/etc/UPower.conf b/etc/UPower.conf +index 1b7f9c3..c82827a 100644 +--- a/etc/UPower.conf ++++ b/etc/UPower.conf +@@ -20,3 +20,12 @@ SleepTimeout=1000 + # default=true + AllowHibernateEncryptedSwap=true + ++ ++# Poll the kernel for dock state changes. ++# ++# Some drivers are still broken, and do not send out uvents when the ++# connected state changes. ++# ++# default=false ++PollDockDevices=false ++ +diff --git a/src/linux/Makefile.am b/src/linux/Makefile.am +index d19b20d..c4646f7 100644 +--- a/src/linux/Makefile.am ++++ b/src/linux/Makefile.am +@@ -5,6 +5,7 @@ INCLUDES = \ + -DUP_COMPILATION \ + -DG_UDEV_API_IS_SUBJECT_TO_CHANGE \ + -DG_LOG_DOMAIN=\"UPower-Linux\" \ ++ -DPACKAGE_SYSCONF_DIR=\""$(sysconfdir)"\" \ + -I$(top_srcdir)/libupower-glib \ + $(USB_CFLAGS) \ + $(GIO_CFLAGS) \ +diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c +index c671d2d..069ca9b 100644 +--- a/src/linux/up-backend.c ++++ b/src/linux/up-backend.c +@@ -284,6 +284,38 @@ up_backend_uevent_signal_handler_cb (GUdevClient *client, const gchar *action, + } + + /** ++ * up_backend_should_poll_docks: ++ **/ ++static gboolean ++up_backend_should_poll_docks (void) ++{ ++ gboolean ret; ++ GKeyFile *keyfile; ++ GError *error = NULL; ++ ++ /* get the settings from the config file */ ++ keyfile = g_key_file_new (); ++ ret = g_key_file_load_from_file (keyfile, ++ PACKAGE_SYSCONF_DIR "/UPower/UPower.conf", ++ G_KEY_FILE_NONE, ++ &error); ++ if (!ret) { ++ g_error ("Failed to get poll setting, assuming FALSE: %s", ++ error->message); ++ g_error_free (error); ++ goto out; ++ } ++ ret = g_key_file_get_boolean (keyfile, ++ "UPower", ++ "PollDockDevices", ++ NULL); ++ g_debug ("Polling docks: %s", ret ? "YES" : "NO"); ++out: ++ g_key_file_free (keyfile); ++ return ret; ++} ++ ++/** + * up_backend_coldplug: + * @backend: The %UpBackend class instance + * @daemon: The %UpDaemon controlling instance +@@ -323,6 +355,8 @@ up_backend_coldplug (UpBackend *backend, UpDaemon *daemon) + + /* add dock update object */ + backend->priv->dock = up_dock_new (); ++ ret = up_backend_should_poll_docks (); ++ up_dock_set_should_poll (backend->priv->dock, ret); + ret = up_dock_coldplug (backend->priv->dock, daemon); + if (!ret) + g_warning ("failed to coldplug dock devices"); +diff --git a/src/linux/up-dock.c b/src/linux/up-dock.c +index 59475f7..78fb7d3 100644 +--- a/src/linux/up-dock.c ++++ b/src/linux/up-dock.c +@@ -106,14 +106,27 @@ up_dock_poll_cb (UpDock *dock) + /** + * up_dock_coldplug: + **/ ++void ++up_dock_set_should_poll (UpDock *dock, gboolean should_poll) ++{ ++ if (should_poll && dock->priv->poll_id == 0) { ++ dock->priv->poll_id = g_timeout_add_seconds (UP_DOCK_POLL_TIMEOUT, ++ (GSourceFunc) up_dock_poll_cb, ++ dock); ++ } else if (dock->priv->poll_id > 0) { ++ g_source_remove (dock->priv->poll_id); ++ dock->priv->poll_id = 0; ++ } ++} ++ ++/** ++ * up_dock_coldplug: ++ **/ + gboolean + up_dock_coldplug (UpDock *dock, UpDaemon *daemon) + { + /* save daemon */ + dock->priv->daemon = g_object_ref (daemon); +- dock->priv->poll_id = g_timeout_add_seconds (UP_DOCK_POLL_TIMEOUT, +- (GSourceFunc) up_dock_poll_cb, +- dock); + return up_dock_refresh (dock); + } + +diff --git a/src/linux/up-dock.h b/src/linux/up-dock.h +index 1f7c80a..0c79251 100644 +--- a/src/linux/up-dock.h ++++ b/src/linux/up-dock.h +@@ -51,6 +51,8 @@ GType up_dock_get_type (void); + UpDock *up_dock_new (void); + gboolean up_dock_coldplug (UpDock *dock, + UpDaemon *daemon); ++void up_dock_set_should_poll (UpDock *dock, ++ gboolean should_poll); + + G_END_DECLS + +-- +cgit v0.8.3-6-g21f6 diff -Nru upower-0.9.8/debian/patches/series upower-0.9.8/debian/patches/series --- upower-0.9.8/debian/patches/series 2011-02-23 08:46:55.000000000 -0800 +++ upower-0.9.8/debian/patches/series 2011-04-13 19:41:12.000000000 -0700 @@ -1 +1,2 @@ # Debian patches for upower +100_upower_conf.patch