summaryrefslogtreecommitdiff
path: root/x11/gnome-desktop/patches/patch-ab
diff options
context:
space:
mode:
Diffstat (limited to 'x11/gnome-desktop/patches/patch-ab')
-rw-r--r--x11/gnome-desktop/patches/patch-ab264
1 files changed, 264 insertions, 0 deletions
diff --git a/x11/gnome-desktop/patches/patch-ab b/x11/gnome-desktop/patches/patch-ab
new file mode 100644
index 00000000000..d708c0b0979
--- /dev/null
+++ b/x11/gnome-desktop/patches/patch-ab
@@ -0,0 +1,264 @@
+$NetBSD: patch-ab,v 1.3 2008/12/24 02:38:18 jmcneill Exp $
+
+--- libgnome-desktop/gnome-rr.c.orig 2008-12-23 21:17:22.000000000 -0500
++++ libgnome-desktop/gnome-rr.c 2008-12-23 21:30:26.000000000 -0500
+@@ -34,6 +34,11 @@
+
+ #define DISPLAY(o) ((o)->info->screen->xdisplay)
+
++#include "config.h"
++#if HAVE_DECL_XRRGETSCREENSIZERANGE > 0
++#define HAVE_XRANDR12
++#endif
++
+ typedef struct ScreenInfo ScreenInfo;
+
+ struct ScreenInfo
+@@ -43,7 +48,9 @@ struct ScreenInfo
+ int min_height;
+ int max_height;
+
++#ifdef HAVE_XRANDR12
+ XRRScreenResources *resources;
++#endif
+
+ GnomeRROutput ** outputs;
+ GnomeRRCrtc ** crtcs;
+@@ -70,7 +77,9 @@ struct GnomeRRScreen
+ struct GnomeRROutput
+ {
+ ScreenInfo * info;
++#ifdef HAVE_XRANDR12
+ RROutput id;
++#endif
+
+ char * name;
+ GnomeRRCrtc * current_crtc;
+@@ -86,13 +95,17 @@ struct GnomeRROutput
+
+ struct GnomeRROutputWrap
+ {
++#ifdef HAVE_XRANDR12
+ RROutput id;
++#endif
+ };
+
+ struct GnomeRRCrtc
+ {
+ ScreenInfo * info;
++#ifdef HAVE_XRANDR12
+ RRCrtc id;
++#endif
+
+ GnomeRRMode * current_mode;
+ GnomeRROutput ** current_outputs;
+@@ -107,13 +120,16 @@ struct GnomeRRCrtc
+ struct GnomeRRMode
+ {
+ ScreenInfo * info;
++#ifdef HAVE_XRANDR12
+ RRMode id;
++#endif
+ char * name;
+ int width;
+ int height;
+ int freq; /* in mHz */
+ };
+
++#ifdef HAVE_XRANDR12
+ /* GnomeRRCrtc */
+ static GnomeRRCrtc * crtc_new (ScreenInfo *info,
+ RRCrtc id);
+@@ -135,7 +151,6 @@ static void mode_initialize
+ XRRModeInfo *info);
+ static void mode_free (GnomeRRMode *mode);
+
+-
+ /* Screen */
+ static GnomeRROutput *
+ gnome_rr_output_by_id (ScreenInfo *info, RROutput id)
+@@ -410,6 +425,7 @@ screen_on_event (GdkXEvent *xevent,
+ /* Pass the event on to GTK+ */
+ return GDK_FILTER_CONTINUE;
+ }
++#endif
+
+ /* Returns NULL if screen could not be created. For instance, if
+ * the driver does not support Xrandr 1.2.
+@@ -419,6 +435,7 @@ gnome_rr_screen_new (GdkScreen *gdk_scre
+ GnomeRRScreenChanged callback,
+ gpointer data)
+ {
++#ifdef HAVE_XRANDR12
+ Display *dpy = GDK_SCREEN_XDISPLAY (gdk_screen);
+ int event_base;
+ int ignore;
+@@ -460,12 +477,14 @@ gnome_rr_screen_new (GdkScreen *gdk_scre
+ return screen;
+ }
+
++#endif /* !HAVE_XRANDR12 */
+ return NULL;
+ }
+
+ void
+ gnome_rr_screen_destroy (GnomeRRScreen *screen)
+ {
++#ifdef HAVE_XRANDR12
+ g_return_if_fail (screen != NULL);
+
+ gdk_window_remove_filter (screen->gdk_root, screen_on_event, screen);
+@@ -474,6 +493,7 @@ gnome_rr_screen_destroy (GnomeRRScreen *
+ screen->info = NULL;
+
+ g_free (screen);
++#endif
+ }
+
+ void
+@@ -483,10 +503,12 @@ gnome_rr_screen_set_size (GnomeRRScreen
+ int mm_width,
+ int mm_height)
+ {
++#ifdef HAVE_XRANDR12
+ g_return_if_fail (screen != NULL);
+
+ XRRSetScreenSize (screen->xdisplay, screen->xroot,
+ width, height, mm_width, mm_height);
++#endif
+ }
+
+ void
+@@ -514,7 +536,11 @@ gnome_rr_screen_get_ranges (GnomeRRScree
+ gboolean
+ gnome_rr_screen_refresh (GnomeRRScreen *screen)
+ {
++#ifdef HAVE_XRANDR12
+ return screen_update (screen, FALSE);
++#else
++ return FALSE;
++#endif
+ }
+
+ GnomeRRMode **
+@@ -553,11 +579,13 @@ gnome_rr_screen_get_crtc_by_id (GnomeRRS
+ g_return_val_if_fail (screen != NULL, NULL);
+ g_return_val_if_fail (screen->info != NULL, NULL);
+
++#ifdef HAVE_XRANDR12
+ for (i = 0; screen->info->crtcs[i] != NULL; ++i)
+ {
+ if (screen->info->crtcs[i]->id == id)
+ return screen->info->crtcs[i];
+ }
++#endif
+
+ return NULL;
+ }
+@@ -571,15 +599,18 @@ gnome_rr_screen_get_output_by_id (GnomeR
+ g_return_val_if_fail (screen != NULL, NULL);
+ g_return_val_if_fail (screen->info != NULL, NULL);
+
++#ifdef HAVE_XRANDR12
+ for (i = 0; screen->info->outputs[i] != NULL; ++i)
+ {
+ if (screen->info->outputs[i]->id == id)
+ return screen->info->outputs[i];
+ }
++#endif
+
+ return NULL;
+ }
+
++#ifdef HAVE_XRANDR12
+ /* GnomeRROutput */
+ static GnomeRROutput *
+ output_new (ScreenInfo *info, RROutput id)
+@@ -721,13 +752,18 @@ output_free (GnomeRROutput *output)
+ {
+ g_free (output);
+ }
++#endif /* !HAVE_XRANDR12 */
+
+ guint32
+ gnome_rr_output_get_id (GnomeRROutput *output)
+ {
+ g_assert(output != NULL);
+
++#ifdef HAVE_XRANDR12
+ return output->id;
++#else
++ return 0;
++#endif
+ }
+
+ const guint8 *
+@@ -945,6 +981,7 @@ gnome_rr_crtc_set_config (GnomeRRCrtc
+ g_return_val_if_fail (y + mode->height <= info->max_height, FALSE);
+ }
+
++#ifdef HAVE_XRANDR12
+ output_ids = g_array_new (FALSE, FALSE, sizeof (RROutput));
+
+ if (outputs)
+@@ -962,6 +999,9 @@ gnome_rr_crtc_set_config (GnomeRRCrtc
+ output_ids->len) == RRSetConfigSuccess;
+
+ g_array_free (output_ids, TRUE);
++#else /* !HAVE_XRANDR12 */
++ result = FALSE;
++#endif
+
+ return result;
+ }
+@@ -979,7 +1019,11 @@ gnome_rr_crtc_get_id (GnomeRRCrtc *crtc)
+ {
+ g_return_val_if_fail (crtc != NULL, 0);
+
++#ifdef HAVE_XRANDR12
+ return crtc->id;
++#else
++ return 0;
++#endif
+ }
+
+ gboolean
+@@ -1038,6 +1082,7 @@ gnome_rr_crtc_supports_rotation (GnomeRR
+ return (crtc->rotations & rotation);
+ }
+
++#ifdef HAVE_XRANDR12
+ static GnomeRRCrtc *
+ crtc_new (ScreenInfo *info, RROutput id)
+ {
+@@ -1123,12 +1168,17 @@ mode_new (ScreenInfo *info, RRMode id)
+
+ return mode;
+ }
++#endif /* !HAVE_XRANDR12 */
+
+ guint32
+ gnome_rr_mode_get_id (GnomeRRMode *mode)
+ {
+ g_return_val_if_fail (mode != NULL, 0);
++#ifdef HAVE_XRANDR12
+ return mode->id;
++#else
++ return 0;
++#endif
+ }
+
+ guint
+@@ -1152,6 +1202,7 @@ gnome_rr_mode_get_height (GnomeRRMode *m
+ return mode->height;
+ }
+
++#ifdef HAVE_XRANDR12
+ static void
+ mode_initialize (GnomeRRMode *mode, XRRModeInfo *info)
+ {
+@@ -1170,3 +1221,4 @@ mode_free (GnomeRRMode *mode)
+ g_free (mode->name);
+ g_free (mode);
+ }
++#endif /* !HAVE_XRANDR12 */