diff --git a/add-randr-12.patch b/add-randr-12.patch index a372540..e9b1f96 100644 --- a/add-randr-12.patch +++ b/add-randr-12.patch @@ -1,6 +1,6 @@ diff -up gnome-desktop-2.21.91/configure.in.add-randr-12 gnome-desktop-2.21.91/configure.in --- gnome-desktop-2.21.91/configure.in.add-randr-12 2008-02-11 13:38:20.000000000 -0500 -+++ gnome-desktop-2.21.91/configure.in 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/configure.in 2008-02-13 10:51:26.000000000 -0500 @@ -51,10 +51,10 @@ AC_SUBST(GNOME_MICRO) AC_SUBST(GNOME_DISTRIBUTOR) AC_SUBST(GNOME_DATE) @@ -18,7 +18,7 @@ diff -up gnome-desktop-2.21.91/configure.in.add-randr-12 gnome-desktop-2.21.91/c diff -up gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am --- gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 2008-02-11 13:35:11.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am 2008-02-13 10:51:26.000000000 -0500 @@ -2,4 +2,7 @@ libgnomeui_desktopdir = $(includedir)/gn libgnomeui_desktop_HEADERS = \ gnome-ditem-edit.h \ @@ -30,7 +30,7 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/Makefile.am.add-randr + diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db.h 2008-02-15 20:28:36.000000000 -0500 @@ -0,0 +1,51 @@ +#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#error This is not for general consumption yet. @@ -85,7 +85,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/monitor-db. +#endif diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h 2008-02-15 20:28:36.000000000 -0500 @@ -0,0 +1,100 @@ +#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#error This is not yet for general consumption. @@ -128,7 +128,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h + int mm_height); +RWCrtc * rw_screen_get_crtc_by_id (RWScreen *screen, + guint32 id); -+void rw_screen_refresh (RWScreen *screen); ++gboolean rw_screen_refresh (RWScreen *screen); +RWOutput * rw_screen_get_output_by_id (RWScreen *screen, + guint32 id); +RWOutput * rw_screen_get_output_by_name (RWScreen *screen, @@ -189,8 +189,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/libgnomeui/randrwrap.h +#endif diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c 2008-02-13 10:36:07.000000000 -0500 -@@ -0,0 +1,1174 @@ ++++ gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c 2008-02-15 20:28:36.000000000 -0500 +@@ -0,0 +1,1178 @@ +#include +#include +#include @@ -531,7 +531,9 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + Configuration *config = g_new0 (Configuration, 1); + GPtrArray *a = g_ptr_array_new (); + int i; -+ RWOutput **rw_outputs = rw_screen_list_outputs (screen); ++ RWOutput **rw_outputs; ++ ++ rw_outputs = rw_screen_list_outputs (screen); + + for (i = 0; rw_outputs[i] != NULL; ++i) + { @@ -579,13 +581,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + } + + crtc = rw_output_get_crtc (rw_output); ++ mode = crtc? rw_crtc_get_current_mode (crtc) : NULL; + -+ if (crtc) ++ if (crtc && mode) + { + output->on = TRUE; + -+ mode = rw_crtc_get_current_mode (crtc); -+ + rw_crtc_get_position (crtc, &output->x, &output->y); + output->width = rw_mode_get_width (mode); + output->height = rw_mode_get_height (mode); @@ -968,10 +969,13 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c + char *file = g_build_filename ( + g_get_home_dir(), ".gnome2", "monitors.xml", NULL); + Configuration **configs = configurations_read (file, NULL); -+ Configuration *current = configuration_new_current (screen); ++ Configuration *current; + Configuration *found; + gboolean result; + ++ rw_screen_refresh (screen); ++ ++ current = configuration_new_current (screen); + if (configs) + { + if ((found = configuration_find (configs, current))) @@ -1367,8 +1371,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/monitor-db.c +} diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c 2008-02-13 10:36:07.000000000 -0500 -@@ -0,0 +1,1042 @@ ++++ gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c 2008-02-15 20:28:36.000000000 -0500 +@@ -0,0 +1,1122 @@ +#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA +#include "libgnomeui/randrwrap.h" +#include @@ -1378,34 +1382,44 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +#include +#include + -+struct RWScreen -+{ -+ GdkScreen * gdk_screen; -+ GdkWindow * gdk_root; -+ Display * xdisplay; -+ Screen * xscreen; -+ Window xroot; -+ -+ int randr_event_base; ++#define DISPLAY(o) ((o)->info->screen->xdisplay) + ++typedef struct ScreenInfo ScreenInfo; ++ ++struct ScreenInfo ++{ + int min_width; + int max_width; + int min_height; + int max_height; -+ -+ RWScreenChanged callback; -+ gpointer data; + + XRRScreenResources *resources; + + RWOutput ** outputs; + RWCrtc ** crtcs; + RWMode ** modes; ++ ++ RWScreen * screen; ++}; ++ ++struct RWScreen ++{ ++ GdkScreen * gdk_screen; ++ GdkWindow * gdk_root; ++ Display * xdisplay; ++ Screen * xscreen; ++ Window xroot; ++ ScreenInfo * info; ++ ++ int randr_event_base; ++ ++ RWScreenChanged callback; ++ gpointer data; +}; + +struct RWOutput +{ -+ RWScreen * screen; ++ ScreenInfo * info; + RROutput id; + + char * name; @@ -1420,9 +1434,14 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + guint8 * edid_data; +}; + ++struct RWOutputWrap ++{ ++ RROutput id; ++}; ++ +struct RWCrtc +{ -+ RWScreen * screen; ++ ScreenInfo * info; + RRCrtc id; + + RWMode * current_mode; @@ -1437,7 +1456,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + +struct RWMode +{ -+ RWScreen * screen; ++ ScreenInfo * info; + RRMode id; + char * name; + int width; @@ -1446,7 +1465,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +}; + +/* RWCrtc */ -+static RWCrtc * crtc_new (RWScreen *screen, ++static RWCrtc * crtc_new (ScreenInfo *info, + RRCrtc id); +static void crtc_free (RWCrtc *crtc); +static void crtc_initialize (RWCrtc *crtc, @@ -1454,7 +1473,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + + +/* RWOutput */ -+static RWOutput *output_new (RWScreen *screen, ++static RWOutput *output_new (ScreenInfo *info, + RROutput id); +static void output_initialize (RWOutput *output, + XRRScreenResources *res); @@ -1462,7 +1481,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + + +/* RWMode */ -+static RWMode * mode_new (RWScreen *screen, ++static RWMode * mode_new (ScreenInfo *info, + RRMode id); +static void mode_initialize (RWMode *mode, + XRRModeInfo *info); @@ -1471,11 +1490,11 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + +/* Screen */ +static RWOutput * -+rw_output_by_id (RWScreen *screen, RROutput id) ++rw_output_by_id (ScreenInfo *info, RROutput id) +{ + RWOutput **output; + -+ for (output = screen->outputs; *output; ++output) ++ for (output = info->outputs; *output; ++output) + { + if ((*output)->id == id) + return *output; @@ -1485,11 +1504,11 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +} + +static RWCrtc * -+crtc_by_id (RWScreen *screen, RRCrtc id) ++crtc_by_id (ScreenInfo *info, RRCrtc id) +{ + RWCrtc **crtc; + -+ for (crtc = screen->crtcs; *crtc; ++crtc) ++ for (crtc = info->crtcs; *crtc; ++crtc) + { + if ((*crtc)->id == id) + return *crtc; @@ -1499,11 +1518,11 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +} + +static RWMode * -+mode_by_id (RWScreen *screen, RRMode id) ++mode_by_id (ScreenInfo *info, RRMode id) +{ + RWMode **mode; + -+ for (mode = screen->modes; *mode; ++mode) ++ for (mode = info->modes; *mode; ++mode) + { + if ((*mode)->id == id) + return *mode; @@ -1513,54 +1532,54 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +} + +static void -+screen_free_resources (RWScreen *screen) ++screen_info_free (ScreenInfo *info) +{ + RWOutput **output; + RWCrtc **crtc; + RWMode **mode; + -+ if (screen->resources) ++ if (info->resources) + { -+ XRRFreeScreenResources (screen->resources); ++ XRRFreeScreenResources (info->resources); + -+ screen->resources = NULL; ++ info->resources = NULL; + } + -+ if (screen->outputs) ++ if (info->outputs) + { -+ for (output = screen->outputs; *output; ++output) ++ for (output = info->outputs; *output; ++output) + output_free (*output); -+ g_free (screen->outputs); ++ g_free (info->outputs); + } + -+ if (screen->crtcs) ++ if (info->crtcs) + { -+ for (crtc = screen->crtcs; *crtc; ++crtc) ++ for (crtc = info->crtcs; *crtc; ++crtc) + crtc_free (*crtc); -+ g_free (screen->crtcs); ++ g_free (info->crtcs); + } + -+ if (screen->modes) ++ if (info->modes) + { -+ for (mode = screen->modes; *mode; ++mode) ++ for (mode = info->modes; *mode; ++mode) + mode_free (*mode); -+ g_free (screen->modes); ++ g_free (info->modes); + } ++ ++ g_free (info); +} + -+static void -+screen_update (RWScreen *screen, -+ gboolean call_callback) ++static gboolean ++fill_out_screen_info (Display *xdisplay, Window xroot, ++ ScreenInfo *info) +{ + XRRScreenResources *resources; + -+ g_return_if_fail (screen != NULL); -+ -+ XRRGetScreenSizeRange (screen->xdisplay, screen->xroot, -+ &(screen->min_width), -+ &(screen->min_height), -+ &(screen->max_width), -+ &(screen->max_height)); ++ XRRGetScreenSizeRange (xdisplay, xroot, ++ &(info->min_width), ++ &(info->min_height), ++ &(info->max_width), ++ &(info->max_height)); + +#if 0 + g_print ("ranges: %d - %d; %d - %d\n", @@ -1568,8 +1587,8 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + screen->min_height, screen->max_height); +#endif + -+ resources = XRRGetScreenResources (screen->xdisplay, screen->xroot); -+ ++ resources = XRRGetScreenResources (xdisplay, xroot); ++ + if (resources) + { + int i; @@ -1577,9 +1596,10 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + RWCrtc **crtc; + RWOutput **output; + -+ screen_free_resources (screen); -+ -+ screen->resources = resources; ++ g_print ("Resource Timestamp: %u\n", (guint32)resources->timestamp); ++ g_print ("Resource Configuration Timestamp: %u\n", (guint32)resources->configTimestamp); ++ ++ info->resources = resources; + + /* We create all the structures before initializing them, so + * that they can refer to each other. @@ -1587,50 +1607,108 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + a = g_ptr_array_new (); + for (i = 0; i < resources->ncrtc; ++i) + { -+ RWCrtc *crtc = crtc_new (screen, resources->crtcs[i]); ++ RWCrtc *crtc = crtc_new (info, resources->crtcs[i]); + + g_ptr_array_add (a, crtc); + } + g_ptr_array_add (a, NULL); -+ screen->crtcs = (RWCrtc **)g_ptr_array_free (a, FALSE); ++ info->crtcs = (RWCrtc **)g_ptr_array_free (a, FALSE); + + a = g_ptr_array_new (); + for (i = 0; i < resources->noutput; ++i) + { -+ RWOutput *output = output_new (screen, resources->outputs[i]); ++ RWOutput *output = output_new (info, resources->outputs[i]); + + g_ptr_array_add (a, output); + } + g_ptr_array_add (a, NULL); -+ screen->outputs = (RWOutput **)g_ptr_array_free (a, FALSE); ++ info->outputs = (RWOutput **)g_ptr_array_free (a, FALSE); + + a = g_ptr_array_new (); + for (i = 0; i < resources->nmode; ++i) + { -+ RWMode *mode = mode_new (screen, resources->modes[i].id); ++ RWMode *mode = mode_new (info, resources->modes[i].id); + + g_ptr_array_add (a, mode); + } + g_ptr_array_add (a, NULL); -+ screen->modes = (RWMode **)g_ptr_array_free (a, FALSE); ++ info->modes = (RWMode **)g_ptr_array_free (a, FALSE); + + /* Initialize */ -+ for (crtc = screen->crtcs; *crtc; ++crtc) ++ for (crtc = info->crtcs; *crtc; ++crtc) + crtc_initialize (*crtc, resources); + -+ for (output = screen->outputs; *output; ++output) ++ for (output = info->outputs; *output; ++output) + output_initialize (*output, resources); + + for (i = 0; i < resources->nmode; ++i) + { -+ RWMode *mode = mode_by_id (screen, resources->modes[i].id); ++ RWMode *mode = mode_by_id (info, resources->modes[i].id); + + mode_initialize (mode, &(resources->modes[i])); + } ++ ++ return TRUE; ++ } ++ else ++ { ++ g_print ("Couldn't get screen resources\n"); ++ ++ return FALSE; ++ } ++} ++ ++static ScreenInfo * ++screen_info_new (RWScreen *screen) ++{ ++ ScreenInfo *info = g_new0 (ScreenInfo, 1); ++ RWOutput **o; ++ ++ info->outputs = NULL; ++ info->crtcs = NULL; ++ info->modes = NULL; ++ info->screen = screen; ++ ++ if (fill_out_screen_info (screen->xdisplay, screen->xroot, info)) ++ { ++ return info; ++ } ++ else ++ { ++ g_free (info); ++ return NULL; ++ } ++ ++ for (o = info->outputs; *o; o++) ++ { ++ ++ } ++ ++} ++ ++static gboolean ++screen_update (RWScreen *screen, gboolean force_callback) ++{ ++ ScreenInfo *info; ++ gboolean changed = FALSE; ++ ++ g_return_val_if_fail (screen != NULL, FALSE); ++ ++ info = screen_info_new (screen); ++ if (info) ++ { ++ if (info->resources->configTimestamp != screen->info->resources->configTimestamp) ++ changed = TRUE; ++ ++ screen_info_free (screen->info); ++ ++ screen->info = info; + } + -+ if (call_callback && screen->callback) ++ if ((changed || force_callback) && screen->callback) + screen->callback (screen, screen->data); ++ ++ return changed; +} + +static GdkFilterReturn @@ -1643,7 +1721,15 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + + if (e->type - screen->randr_event_base == RRNotify) + { -+ /* FIXME: we probably need to be more discriminating in ++ XRRNotifyEvent *event = (XRRNotifyEvent *)e; ++ ++ switch (event->subtype) ++ { ++ default: ++ break; ++ } ++ ++ /* FIXME: we may need to be more discriminating in + * what causes 'changed' events + */ + screen_update (screen, TRUE); @@ -1671,17 +1757,13 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + screen->xroot = gdk_x11_drawable_get_xid (screen->gdk_root); + screen->xdisplay = dpy; + screen->xscreen = gdk_x11_screen_get_xscreen (screen->gdk_screen); -+ ++ + screen->callback = callback; + screen->data = data; + + screen->randr_event_base = event_base; -+ -+ screen->outputs = NULL; -+ screen->crtcs = NULL; -+ screen->modes = NULL; -+ -+ screen_update (screen, FALSE); ++ ++ screen->info = screen_info_new (screen); + + XRRSelectInput (screen->xdisplay, + screen->xroot, @@ -1724,40 +1806,40 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + g_return_if_fail (screen != NULL); + + if (min_width) -+ *min_width = screen->min_width; ++ *min_width = screen->info->min_width; + + if (max_width) -+ *max_width = screen->max_width; ++ *max_width = screen->info->max_width; + + if (min_height) -+ *min_height = screen->min_height; ++ *min_height = screen->info->min_height; + + if (max_height) -+ *max_height = screen->max_height; ++ *max_height = screen->info->max_height; +} + -+void ++gboolean +rw_screen_refresh (RWScreen *screen) +{ -+ screen_update (screen, TRUE); ++ return screen_update (screen, FALSE); +} + +RWMode ** +rw_screen_list_modes (RWScreen *screen) +{ -+ return screen->modes; ++ return screen->info->modes; +} + +RWCrtc ** +rw_screen_list_crtcs (RWScreen *screen) +{ -+ return screen->crtcs; ++ return screen->info->crtcs; +} + +RWOutput ** +rw_screen_list_outputs (RWScreen *screen) +{ -+ return screen->outputs; ++ return screen->info->outputs; +} + +RWCrtc * @@ -1766,10 +1848,10 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +{ + int i; + -+ for (i = 0; screen->crtcs[i] != NULL; ++i) ++ for (i = 0; screen->info->crtcs[i] != NULL; ++i) + { -+ if (screen->crtcs[i]->id == id) -+ return screen->crtcs[i]; ++ if (screen->info->crtcs[i]->id == id) ++ return screen->info->crtcs[i]; + } + + return NULL; @@ -1781,10 +1863,10 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +{ + int i; + -+ for (i = 0; screen->outputs[i] != NULL; ++i) ++ for (i = 0; screen->info->outputs[i] != NULL; ++i) + { -+ if (screen->outputs[i]->id == id) -+ return screen->outputs[i]; ++ if (screen->info->outputs[i]->id == id) ++ return screen->info->outputs[i]; + } + + return NULL; @@ -1792,12 +1874,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + +/* RWOutput */ +static RWOutput * -+output_new (RWScreen *screen, RROutput id) ++output_new (ScreenInfo *info, RROutput id) +{ + RWOutput *output = g_new0 (RWOutput, 1); + + output->id = id; -+ output->screen = screen; ++ output->info = info; + + return output; +} @@ -1839,11 +1921,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +static guint8 * +read_edid_data (RWOutput *output) +{ -+ Atom edid_atom = XInternAtom (output->screen->xdisplay, "EDID_DATA", FALSE); ++ Atom edid_atom = XInternAtom (DISPLAY (output), "EDID_DATA", FALSE); + guint8 *result; + int len; + -+ result = get_property (output->screen->xdisplay, output->id, edid_atom, &len); ++ result = get_property (DISPLAY (output), ++ output->id, edid_atom, &len); + + if (result) + { @@ -1860,10 +1943,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +output_initialize (RWOutput *output, XRRScreenResources *res) +{ + XRROutputInfo *info = XRRGetOutputInfo ( -+ output->screen->xdisplay, res, output->id); ++ DISPLAY (output), res, output->id); + GPtrArray *a; + int i; + ++ g_print ("Output %lx Timestamp: %u\n", output->id, (guint32)info->timestamp); ++ + if (!info) + { + /* FIXME */ @@ -1871,7 +1956,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + } + + output->name = g_strdup (info->name); /* FIXME: what is nameLen used for? */ -+ output->current_crtc = crtc_by_id (output->screen, info->crtc); ++ output->current_crtc = crtc_by_id (output->info, info->crtc); + output->width_mm = info->mm_width; + output->height_mm = info->mm_height; + output->connected = (info->connection == RR_Connected); @@ -1881,7 +1966,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + + for (i = 0; i < info->ncrtc; ++i) + { -+ RWCrtc *crtc = crtc_by_id (output->screen, info->crtcs[i]); ++ RWCrtc *crtc = crtc_by_id (output->info, info->crtcs[i]); + + if (crtc) + g_ptr_array_add (a, crtc); @@ -1893,7 +1978,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + a = g_ptr_array_new (); + for (i = 0; i < info->nclone; ++i) + { -+ RWOutput *output = rw_output_by_id (output->screen, info->clones[i]); ++ RWOutput *output = rw_output_by_id (output->info, info->clones[i]); + + if (output) + g_ptr_array_add (a, output); @@ -1905,7 +1990,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + a = g_ptr_array_new (); + for (i = 0; i < info->nmode; ++i) + { -+ RWMode *mode = mode_by_id (output->screen, info->modes[i]); ++ RWMode *mode = mode_by_id (output->info, info->modes[i]); + + if (mode) + g_ptr_array_add (a, mode); @@ -1945,9 +2030,9 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +{ + int i; + -+ for (i = 0; screen->outputs[i] != NULL; ++i) ++ for (i = 0; screen->info->outputs[i] != NULL; ++i) + { -+ RWOutput *output = screen->outputs[i]; ++ RWOutput *output = screen->info->outputs[i]; + + if (strcmp (output->name, name) == 0) + return output; @@ -2118,22 +2203,19 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + RWOutput **outputs, + int n_outputs) +{ -+ RWScreen *screen; ++ ScreenInfo *info; + GArray *output_ids; + int i; + + g_return_val_if_fail (crtc != NULL, FALSE); + g_return_val_if_fail (mode != NULL || outputs == NULL || n_outputs == 0, FALSE); + -+ screen = crtc->screen; -+ ++ info = crtc->info; ++ + if (mode) + { -+#if 0 -+ g_print ("x: %d mode->width: %d max width: %d\n", x, mode->width, screen->max_width); -+#endif -+ g_return_val_if_fail (x + mode->width <= screen->max_width, FALSE); -+ g_return_val_if_fail (y + mode->height <= screen->max_height, FALSE); ++ g_return_val_if_fail (x + mode->width <= info->max_width, FALSE); ++ g_return_val_if_fail (y + mode->height <= info->max_height, FALSE); + } + + output_ids = g_array_new (FALSE, FALSE, sizeof (RROutput)); @@ -2144,7 +2226,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + g_array_append_val (output_ids, outputs[i]->id); + } + -+ XRRSetCrtcConfig (screen->xdisplay, screen->resources, crtc->id, ++ XRRSetCrtcConfig (DISPLAY (crtc), info->resources, crtc->id, + CurrentTime, + x, y, + mode? mode->id : None, @@ -2227,12 +2309,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +} + +static RWCrtc * -+crtc_new (RWScreen *screen, RROutput id) ++crtc_new (ScreenInfo *info, RROutput id) +{ + RWCrtc *crtc = g_new0 (RWCrtc, 1); + + crtc->id = id; -+ crtc->screen = screen; ++ crtc->info = info; + + return crtc; +} @@ -2240,10 +2322,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +static void +crtc_initialize (RWCrtc *crtc, XRRScreenResources *res) +{ -+ XRRCrtcInfo *info = XRRGetCrtcInfo (crtc->screen->xdisplay, res, crtc->id); ++ XRRCrtcInfo *info = XRRGetCrtcInfo (DISPLAY (crtc), res, crtc->id); + GPtrArray *a; + int i; + ++ g_print ("CRTC %lx Timestamp: %u\n", crtc->id, (guint32)info->timestamp); ++ + if (!info) + { + /* FIXME: We need to reaquire the screen resources */ @@ -2251,7 +2335,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + } + + /* RWMode */ -+ crtc->current_mode = mode_by_id (crtc->screen, info->mode); ++ crtc->current_mode = mode_by_id (crtc->info, info->mode); + + crtc->x = info->x; + crtc->y = info->y; @@ -2260,7 +2344,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + a = g_ptr_array_new (); + for (i = 0; i < info->noutput; ++i) + { -+ RWOutput *output = rw_output_by_id (crtc->screen, info->outputs[i]); ++ RWOutput *output = rw_output_by_id (crtc->info, info->outputs[i]); + + if (output) + g_ptr_array_add (a, output); @@ -2272,7 +2356,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + a = g_ptr_array_new (); + for (i = 0; i < info->npossible; ++i) + { -+ RWOutput *output = rw_output_by_id (crtc->screen, info->possible[i]); ++ RWOutput *output = rw_output_by_id (crtc->info, info->possible[i]); + + if (output) + g_ptr_array_add (a, output); @@ -2297,12 +2381,12 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + +/* RWMode */ +static RWMode * -+mode_new (RWScreen *screen, RRMode id) ++mode_new (ScreenInfo *info, RRMode id) +{ + RWMode *mode = g_new0 (RWMode, 1); + + mode->id = id; -+ mode->screen = screen; ++ mode->info = info; + + return mode; +} @@ -2376,9 +2460,9 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + on_screen_changed, + NULL); + -+ for (i = 0; screen->crtcs[i]; ++i) ++ for (i = 0; screen->info->crtcs[i]; ++i) + { -+ RWCrtc *crtc = screen->crtcs[i]; ++ RWCrtc *crtc = screen->info->crtcs[i]; + + if (crtc->current_mode) + { @@ -2392,9 +2476,9 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c + } + } + -+ for (i = 0; screen->outputs[i]; ++i) ++ for (i = 0; screen->info->outputs[i]; ++i) + { -+ RWOutput *output = screen->outputs[i]; ++ RWOutput *output = screen->info->outputs[i]; + + g_print ("Output %s currently", output->name); + @@ -2413,7 +2497,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/randrwrap.c +#endif diff -up gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 gnome-desktop-2.21.91/libgnome-desktop/Makefile.am --- gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 2008-02-11 13:35:11.000000000 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/Makefile.am 2008-02-13 10:37:10.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/Makefile.am 2008-02-13 10:51:26.000000000 -0500 @@ -20,7 +20,12 @@ libgnome_desktop_2_la_SOURCES = \ gnome-desktop-item.c \ gnome-ditem-edit.c \ @@ -2430,7 +2514,7 @@ diff -up gnome-desktop-2.21.91/libgnome-desktop/Makefile.am.add-randr-12 gnome-d $(XLIB_LIBS) \ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c 2008-02-15 20:28:36.000000000 -0500 @@ -0,0 +1,551 @@ +/* + * Copyright 2007 Red Hat, Inc. @@ -2985,7 +3069,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid-parse.c +} diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid.h --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/edid.h 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/edid.h 2008-02-15 20:28:36.000000000 -0500 @@ -0,0 +1,170 @@ +typedef unsigned char uchar; +typedef struct MonitorInfo MonitorInfo; @@ -3159,7 +3243,7 @@ diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/edid.h + const MonitorInfo *info); diff -up /dev/null gnome-desktop-2.21.91/libgnome-desktop/display-name.c --- /dev/null 2008-02-13 09:53:53.228642516 -0500 -+++ gnome-desktop-2.21.91/libgnome-desktop/display-name.c 2008-02-13 10:36:07.000000000 -0500 ++++ gnome-desktop-2.21.91/libgnome-desktop/display-name.c 2008-02-15 20:28:36.000000000 -0500 @@ -0,0 +1,193 @@ +/* + * Copyright 2007 Red Hat, Inc. diff --git a/gnome-desktop.spec b/gnome-desktop.spec index 6a7d5aa..0645561 100644 --- a/gnome-desktop.spec +++ b/gnome-desktop.spec @@ -12,7 +12,7 @@ Summary: Package containing code shared among gnome-panel, gnome-session, nautilus, etc Name: gnome-desktop Version: 2.21.91 -Release: 4%{?dist} +Release: 5%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-desktop/2.21/%{name}-%{version}.tar.bz2 License: GPLv2+ and LGPLv2+ @@ -119,6 +119,9 @@ rm -rf $RPM_BUILD_ROOT %doc %{_datadir}/gtk-doc/html/gnome-desktop/ %changelog +* Fri Feb 15 2008 Soren Sandmann - 2.21.91-5 +* Update randr code + * Wed Feb 13 2008 Soren Sandmann - 2.21.91-4 - Update randrwrap