diff options
author | Rémi Cardona <remi@gentoo.org> | 2009-10-26 16:06:59 +0000 |
---|---|---|
committer | Rémi Cardona <remi@gentoo.org> | 2009-10-26 16:06:59 +0000 |
commit | 64a96ee56357e24b42fb9821de868687e4a9e37d (patch) | |
tree | 0adcbd247f8afc20c9a0d15c68c08865668e3198 /gnome-extra/gnome-power-manager/files | |
parent | amd64 stable wrt #290483 (diff) | |
download | gentoo-2-64a96ee56357e24b42fb9821de868687e4a9e37d.tar.gz gentoo-2-64a96ee56357e24b42fb9821de868687e4a9e37d.tar.bz2 gentoo-2-64a96ee56357e24b42fb9821de868687e4a9e37d.zip |
gnome-extra/gnome-power-manager: backport patches from upstream, add randr patch
(Portage version: 2.2_rc46/cvs/Linux i686)
Diffstat (limited to 'gnome-extra/gnome-power-manager/files')
4 files changed, 149 insertions, 93 deletions
diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.1-fix-xrandr-1.3-detection.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.1-fix-xrandr-1.3-detection.patch deleted file mode 100644 index 192047f9e71e..000000000000 --- a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.1-fix-xrandr-1.3-detection.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 383f735200a5f838ee93eb137df65df7e266fc4c Mon Sep 17 00:00:00 2001 -From: Priit Laes <plaes@plaes.org> -Date: Mon, 11 May 2009 13:11:45 +0000 -Subject: Check whether xrandr-1.3 features are really supported by xorg-server. - -Fixes #582142. ---- -diff --git a/src/gpm-brightness-xrandr.c b/src/gpm-brightness-xrandr.c -index d6fb595..b7a5515 100644 ---- a/src/gpm-brightness-xrandr.c -+++ b/src/gpm-brightness-xrandr.c -@@ -60,8 +60,11 @@ struct GpmBrightnessXRandRPrivate - Display *dpy; - guint shared_value; - gboolean has_extension; -+#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) -+ gboolean has_randr13; -+#endif - gboolean hw_changed; -- /* An cache of XRRScreenResources is used as XRRGetScreenResources is expensive */ -+ /* A cache of XRRScreenResources is used as XRRGetScreenResources is expensive */ - GPtrArray *resources; - }; - -@@ -170,6 +173,34 @@ gpm_brightness_xrandr_setup_display (GpmBrightnessXRandR *brightness) - return TRUE; - } - -+#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) -+/** -+ * gpm_brightness_xrandr_setup_version: Check whether xserver really supports xrandr-1.3 features. -+ **/ -+static gboolean -+gpm_brightness_xrandr_setup_version (GpmBrightnessXRandR *brightness) -+{ -+ gint major, minor; -+ -+ g_return_val_if_fail (GPM_IS_BRIGHTNESS_XRANDR (brightness), FALSE); -+ -+ /* get the display */ -+ brightness->priv->dpy = GDK_DISPLAY(); -+ if (!brightness->priv->dpy) { -+ egg_error ("Cannot open display"); -+ return FALSE; -+ } -+ if (!XRRQueryVersion (brightness->priv->dpy, &major, &minor)) { -+ return FALSE; -+ } -+ if (major == 1 && minor < 3) { -+ egg_debug ("RandR version %d.%d does not support XRRGetScreenResourcesCurrent", major, minor); -+ return FALSE; -+ } -+ return TRUE; -+} -+#endif -+ - /** - * gpm_brightness_xrandr_output_get_limits: - **/ -@@ -616,9 +647,14 @@ gpm_brightness_xrandr_update_cache (GpmBrightnessXRandR *brightness) - root = RootWindow (brightness->priv->dpy, screen); - /* XRRGetScreenResourcesCurrent is less expensive than - XRRGetScreenResources, however it is available only -- in RandR 1.3 or higher */ -+ in RandR 1.3 or higher and of course xserver needs -+ to support it. -+ */ - #if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) -- resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root); -+ if (brightness->priv->has_randr13) -+ resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root); -+ else -+ resource = XRRGetScreenResources (brightness->priv->dpy, root); - #else - resource = XRRGetScreenResources (brightness->priv->dpy, root); - #endif -@@ -684,8 +720,13 @@ gpm_brightness_xrandr_init (GpmBrightnessXRandR *brightness) - - /* can we do this */ - brightness->priv->has_extension = gpm_brightness_xrandr_setup_display (brightness); -- if (brightness->priv->has_extension == FALSE) -+ if (brightness->priv->has_extension == FALSE) { -+ egg_debug ("no XRANDR extension, so aborting init"); - return; -+ } -+#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) -+ brightness->priv->has_randr13 = gpm_brightness_xrandr_setup_version (brightness); -+#endif - - screen = gdk_screen_get_default (); - window = gdk_screen_get_root_window (screen); --- -cgit v0.8.2 diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Check-for-XRR-functions-using-library-version-instea.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Check-for-XRR-functions-using-library-version-instea.patch new file mode 100644 index 000000000000..71dd94d8671f --- /dev/null +++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Check-for-XRR-functions-using-library-version-instea.patch @@ -0,0 +1,85 @@ +From 558a5634d60221e5485083193155d1ee062c8e0e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Cardona?= <remi@gentoo.org> +Date: Fri, 11 Sep 2009 21:33:58 +0200 +Subject: [PATCH] Check for XRR* functions using library version instead of proto version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +randrproto 1.3 can be installed with libXrandr 1.2, which causes linking +errors with g-p-m. This patch checks that libXrandr (and not randrproto) +1.3 is available. + +Signed-off-by: Rémi Cardona <remi@gentoo.org> +--- + configure.ac | 4 ++++ + src/gpm-brightness-xrandr.c | 13 ++++++------- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 4cbe47c..4baa0cf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -171,6 +171,10 @@ PKG_CHECK_MODULES(XRANDR, [ + AC_SUBST(XRANDR_CFLAGS) + AC_SUBST(XRANDR_LIBS) + ++PKG_CHECK_EXISTS( ++ [xrandr >= 1.3], ++ [AC_DEFINE(HAVE_XRANDR_13, 1, [xrandr 1.3 available])]) ++ + PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED) + AC_SUBST(LIBNOTIFY_CFLAGS) + AC_SUBST(LIBNOTIFY_LIBS) +diff --git a/src/gpm-brightness-xrandr.c b/src/gpm-brightness-xrandr.c +index cce4df2..3332be3 100644 +--- a/src/gpm-brightness-xrandr.c ++++ b/src/gpm-brightness-xrandr.c +@@ -60,7 +60,7 @@ struct GpmBrightnessXRandRPrivate + Display *dpy; + guint shared_value; + gboolean has_extension; +-#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) ++#ifdef HAVE_XRANDR_13 + gboolean has_randr13; + #endif + gboolean hw_changed; +@@ -173,7 +173,7 @@ gpm_brightness_xrandr_setup_display (GpmBrightnessXRandR *brightness) + return TRUE; + } + +-#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) ++#ifdef HAVE_XRANDR_13 + /** + * gpm_brightness_xrandr_setup_version: Check whether xserver really supports xrandr-1.3 features. + **/ +@@ -650,14 +650,13 @@ gpm_brightness_xrandr_update_cache (GpmBrightnessXRandR *brightness) + in RandR 1.3 or higher and of course xserver needs + to support it. + */ +-#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) ++#ifdef HAVE_XRANDR_13 + if (brightness->priv->has_randr13) + resource = XRRGetScreenResourcesCurrent (brightness->priv->dpy, root); + else +- resource = XRRGetScreenResources (brightness->priv->dpy, root); +-#else +- resource = XRRGetScreenResources (brightness->priv->dpy, root); + #endif ++ resource = XRRGetScreenResources (brightness->priv->dpy, root); ++ + if (resource != NULL) { + egg_debug ("adding resource %p", resource); + g_ptr_array_add (brightness->priv->resources, resource); +@@ -724,7 +723,7 @@ gpm_brightness_xrandr_init (GpmBrightnessXRandR *brightness) + egg_debug ("no XRANDR extension, so aborting init"); + return; + } +-#if (RANDR_MAJOR == 1 && RANDR_MINOR >= 3) ++#ifdef HAVE_XRANDR_13 + brightness->priv->has_randr13 = gpm_brightness_xrandr_setup_version (brightness); + #endif + +-- +1.6.5.1 + diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Remove-an-unused-include-to-fix-compile.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Remove-an-unused-include-to-fix-compile.patch new file mode 100644 index 000000000000..10fd0001865d --- /dev/null +++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Remove-an-unused-include-to-fix-compile.patch @@ -0,0 +1,25 @@ +From 83ab201c9c4637f2b81dc640f297178f850450b8 Mon Sep 17 00:00:00 2001 +From: Matthias Clasen <mclasen@redhat.com> +Date: Tue, 28 Jul 2009 08:42:46 +0100 +Subject: [PATCH] Remove an unused include to fix compile + +Signed-off-by: Richard Hughes <richard@hughsie.com> +--- + src/gpm-dpms.c | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/src/gpm-dpms.c b/src/gpm-dpms.c +index a58ed7d..d939b80 100644 +--- a/src/gpm-dpms.c ++++ b/src/gpm-dpms.c +@@ -40,7 +40,6 @@ + #ifdef HAVE_DPMS_EXTENSION + #include <X11/Xproto.h> + #include <X11/extensions/dpms.h> +-#include <X11/extensions/dpmsstr.h> + #endif + + #include "egg-debug.h" +-- +1.6.5.1 + diff --git a/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Use-a-larger-DPMS-idletime-timeout-to-mitigate-an-XS.patch b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Use-a-larger-DPMS-idletime-timeout-to-mitigate-an-XS.patch new file mode 100644 index 000000000000..f1e4b5384df2 --- /dev/null +++ b/gnome-extra/gnome-power-manager/files/gnome-power-manager-2.26.4-Use-a-larger-DPMS-idletime-timeout-to-mitigate-an-XS.patch @@ -0,0 +1,39 @@ +From bebf24f41c43f0b2338aefea87f39ba7423d02be Mon Sep 17 00:00:00 2001 +From: Richard Hughes <richard@hughsie.com> +Date: Fri, 14 Aug 2009 11:17:45 +0100 +Subject: [PATCH] Use a larger DPMS idletime timeout to mitigate an XSync bug + +--- + src/gpm-idle.c | 9 +++++++-- + 1 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/gpm-idle.c b/src/gpm-idle.c +index 852f0f3..abe6075 100644 +--- a/src/gpm-idle.c ++++ b/src/gpm-idle.c +@@ -51,6 +51,11 @@ + #define GPM_IDLE_TIMEOUT_IGNORE_DPMS_CHANGE 1.0f /* seconds */ + #define GPM_IDLE_IDLETIME_ID 1 + ++/* XSync seems to be unreliable when setting small values of time. ++ * Ideally we want this to be 1ms (or smaller!) to reduce the chance of a race, ++ * but this fails to trigger on some systems. */ ++#define GPM_IDLE_SMALLEST_RESET_VALUE 500 /* ms */ ++ + struct GpmIdlePrivate + { + EggIdletime *idletime; +@@ -366,8 +371,8 @@ gpm_idle_idletime_reset_cb (EggIdletime *idletime, GpmIdle *idle) + if (idle->priv->mode == GPM_IDLE_MODE_BLANK && + elapsed < GPM_IDLE_TIMEOUT_IGNORE_DPMS_CHANGE) { + egg_debug ("ignoring reset, as we've just done a state change"); +- /* make sure we trigger a short 1ms timeout so we can get the expired signal */ +- egg_idletime_alarm_set (idle->priv->idletime, GPM_IDLE_IDLETIME_ID, 1); ++ /* make sure we trigger a short timeout so we can get the expired signal */ ++ egg_idletime_alarm_set (idle->priv->idletime, GPM_IDLE_IDLETIME_ID, GPM_IDLE_SMALLEST_RESET_VALUE); + return; + } + +-- +1.6.5.1 + |