[gnome-panel] [panel] Use XRRGetScreenResourcesCurrent() when possible
- From: Vincent Untz <vuntz src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-panel] [panel] Use XRRGetScreenResourcesCurrent() when possible
- Date: Tue, 25 Aug 2009 13:09:21 +0000 (UTC)
commit b7efb843fe6a23cf0efc41fd7c07b7cfa1c6074b
Author: Vincent Untz <vuntz gnome org>
Date: Fri Aug 21 12:34:24 2009 +0200
[panel] Use XRRGetScreenResourcesCurrent() when possible
This is cheaper than XRRGetScreenResources(), but only possible with
randr 1.3.
Suggested by Federico Mena Quintero <federico novell com>
gnome-panel/panel-multiscreen.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gnome-panel/panel-multiscreen.c b/gnome-panel/panel-multiscreen.c
index 488595f..b301753 100644
--- a/gnome-panel/panel-multiscreen.c
+++ b/gnome-panel/panel-multiscreen.c
@@ -135,7 +135,15 @@ panel_multiscreen_get_randr_monitors_for_screen (GdkScreen *screen,
xdisplay = GDK_SCREEN_XDISPLAY (screen);
xroot = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen));
+#if (RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 3))
+ if (have_randr_1_3)
+ resources = XRRGetScreenResourcesCurrent (xdisplay, xroot);
+ else
+ resources = XRRGetScreenResources (xdisplay, xroot);
+#else
resources = XRRGetScreenResources (xdisplay, xroot);
+#endif
+
if (!resources)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]