rpms/gnome-desktop/devel add-randr-12.patch, 1.15, 1.16 gnome-desktop.spec, 1.137, 1.138
Soren Sandmann Pedersen (ssp)
fedora-extras-commits at redhat.com
Sat Apr 5 16:41:07 UTC 2008
Author: ssp
Update of /cvs/pkgs/rpms/gnome-desktop/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20652
Modified Files:
add-randr-12.patch gnome-desktop.spec
Log Message:
Update rnadr
add-randr-12.patch:
Index: add-randr-12.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/devel/add-randr-12.patch,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- add-randr-12.patch 20 Mar 2008 05:29:39 -0000 1.15
+++ add-randr-12.patch 5 Apr 2008 16:40:52 -0000 1.16
@@ -1,6 +1,6 @@
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/randrwrap.c
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/randrwrap.c 2008-03-20 01:22:07.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/randrwrap.c 2008-04-05 12:33:34.000000000 -0400
@@ -0,0 +1,1124 @@
+#define I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA
+#include "libgnomeui/randrwrap.h"
@@ -1128,8 +1128,8 @@
+#endif
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/display-name.c
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/display-name.c 2008-03-20 01:22:07.000000000 -0400
-@@ -0,0 +1,249 @@
++++ gnome-desktop-2.22.0/libgnome-desktop/display-name.c 2008-04-05 12:33:34.000000000 -0400
+@@ -0,0 +1,252 @@
+/*
+ * Copyright 2007 Red Hat, Inc.
+ *
@@ -1331,28 +1331,31 @@
+make_display_name (const char *output_name,
+ const MonitorInfo *info)
+{
-+ const char *vendor = find_vendor (info->manufacturer_code);
++ const char *vendor;
+ int width_mm, height_mm, inches;
+
-+ /* This is a bit of a hack - it would be better to have X
-+ * just report whether the output is a laptop panel
-+ */
-+ if (output_name)
++ if (output_name &&
++ (strstr ("lvds", output_name) ||
++ strstr ("LVDS", output_name) ||
++ strstr ("Lvds", output_name)))
+ {
-+ if (strstr ("lvds", output_name) ||
-+ strstr ("LVDS", output_name) ||
-+ strstr ("Lvds", output_name))
-+ {
-+ vendor = "Laptop";
-+ }
++ vendor = "Laptop";
+ }
-+
-+ if (info->width_mm != -1 && info->height_mm)
++ else if (info)
++ {
++ vendor = find_vendor (info->manufacturer_code);
++ }
++ else
++ {
++ vendor = "Unknown";
++ }
++
++ if (info && info->width_mm != -1 && info->height_mm)
+ {
+ width_mm = info->width_mm;
+ height_mm = info->height_mm;
+ }
-+ else if (info->n_detailed_timings)
++ else if (info && info->n_detailed_timings)
+ {
+ width_mm = info->detailed_timings[0].width_mm;
+ height_mm = info->detailed_timings[0].height_mm;
@@ -1362,7 +1365,7 @@
+ width_mm = -1;
+ height_mm = -1;
+ }
-+
++
+ if (width_mm != -1 && height_mm != -1)
+ {
+ double d = sqrt (width_mm * width_mm + height_mm * height_mm);
@@ -1381,8 +1384,8 @@
+}
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/monitor-db.h
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/monitor-db.h 2008-03-20 01:22:07.000000000 -0400
-@@ -0,0 +1,54 @@
++++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/monitor-db.h 2008-04-05 12:33:34.000000000 -0400
+@@ -0,0 +1,56 @@
+#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA
+#error This is not for general consumption yet.
+#endif
@@ -1422,6 +1425,8 @@
+
+struct Configuration
+{
++ gboolean clone;
++
+ Output **outputs;
+};
+
@@ -1439,7 +1444,7 @@
+#endif
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/randrwrap.h
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/randrwrap.h 2008-03-20 01:22:07.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/randrwrap.h 2008-04-05 12:33:34.000000000 -0400
@@ -0,0 +1,100 @@
+#ifndef I_KNOW_THIS_IS_UNSTABLE_AND_ONLY_IN_FEDORA
+#error This is not yet for general consumption.
@@ -1543,7 +1548,7 @@
+#endif
diff -up gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/Makefile.am
--- gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/Makefile.am.add-randr-12 2008-03-10 16:44:42.000000000 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/Makefile.am 2008-03-20 01:19:38.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/libgnomeui/Makefile.am 2008-04-03 14:24:06.000000000 -0400
@@ -2,4 +2,7 @@ libgnomeui_desktopdir = $(includedir)/gn
libgnomeui_desktop_HEADERS = \
gnome-ditem-edit.h \
@@ -1555,8 +1560,8 @@
+
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/monitor-db.c
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/monitor-db.c 2008-03-20 01:22:07.000000000 -0400
-@@ -0,0 +1,1234 @@
++++ gnome-desktop-2.22.0/libgnome-desktop/monitor-db.c 2008-04-05 12:33:34.000000000 -0400
+@@ -0,0 +1,1309 @@
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
@@ -1577,6 +1582,7 @@
+ Output **outputs);
+static void crtc_assignment_free (CrtcAssignment *assign);
+static void output_free (Output *output);
++static Output * output_copy (Output *output);
+
+typedef struct Parser Parser;
+
@@ -1681,6 +1687,7 @@
+ g_assert (parser->configuration == NULL);
+
+ parser->configuration = g_new0 (Configuration, 1);
++ parser->configuration->clone = FALSE;
+ parser->configuration->outputs = g_new0 (Output *, 1);
+ }
+
@@ -1734,6 +1741,11 @@
+ strncpy (parser->output->vendor, text, 3);
+ parser->output->vendor[3] = 0;
+ }
++ else if (stack_is (parser, "clone", "configuration", NULL))
++ {
++ if (strcmp (text, "yes") == 0)
++ parser->configuration->clone = TRUE;
++ }
+ else if (stack_is (parser, "product", "output", "configuration", NULL))
+ {
+ parser->output->connected = TRUE;
@@ -1872,8 +1884,6 @@
+ if (!parse_file_gmarkup (filename, &callbacks, parser, error))
+ {
+ result = NULL;
-+
-+ g_print ("parse error\n");
+
+ g_assert (parser->outputs);
+ goto out;
@@ -1897,11 +1907,15 @@
+{
+ Configuration *config = g_new0 (Configuration, 1);
+ GPtrArray *a = g_ptr_array_new ();
-+ int i;
+ RWOutput **rw_outputs;
++ int i;
++ int clone_width = -1;
++ int clone_height = -1;
+
+ rw_outputs = rw_screen_list_outputs (screen);
-+
++
++ config->clone = TRUE;
++
+ for (i = 0; rw_outputs[i] != NULL; ++i)
+ {
+ RWOutput *rw_output = rw_outputs[i];
@@ -1924,9 +1938,11 @@
+ }
+ else
+ {
++ MonitorInfo *info = NULL;
++
+ if (edid_data)
+ {
-+ MonitorInfo *info = decode_edid (edid_data);
++ info = decode_edid (edid_data);
+
+ memcpy (output->vendor, info->manufacturer_code,
+ sizeof (output->vendor));
@@ -1934,19 +1950,19 @@
+ output->product = info->product_code;
+ output->serial = info->serial_number;
+ output->aspect = info->aspect_ratio;
-+ output->display_name = make_display_name (
-+ rw_output_get_name (rw_output), info);
-+
-+ g_free (info);
+ }
+ else
+ {
+ strcpy (output->vendor, "???");
+ output->product = 0;
+ output->serial = 0;
-+ output->display_name = g_strdup ("Unknown");
+ }
+
++ output->display_name = make_display_name (
++ rw_output_get_name (rw_output), info);
++
++ g_free (info);
++
+ crtc = rw_output_get_crtc (rw_output);
+ mode = crtc? rw_crtc_get_current_mode (crtc) : NULL;
+
@@ -1959,10 +1975,25 @@
+ output->height = rw_mode_get_height (mode);
+ output->rate = rw_mode_get_freq (mode);
+ output->rotation = rw_crtc_get_current_rotation (crtc);
++
++ if (output->x != 0 || output->y != 0)
++ config->clone = FALSE;
++
++ if (clone_width == -1)
++ {
++ clone_width = output->width;
++ clone_height = output->height;
++ }
++ else if (clone_width != output->width ||
++ clone_height != output->height)
++ {
++ config->clone = FALSE;
++ }
+ }
+ else
+ {
+ output->on = FALSE;
++ config->clone = FALSE;
+ }
+
+ /* Get preferred size for the monitor */
@@ -2016,17 +2047,41 @@
+{
+ if (output->display_name)
+ g_free (output->display_name);
++
++ if (output->name)
++ g_free (output->name);
+
+ g_free (output);
+}
+
-+void
-+configuration_free (Configuration *config)
++static Output *
++output_copy (Output *output)
++{
++ Output *copy = g_new0 (Output, 1);
++
++ *copy = *output;
++
++ copy->name = g_strdup (output->name);
++ copy->display_name = g_strdup (output->display_name);
++
++ return copy;
++}
++
++static void
++outputs_free (Output **outputs)
+{
+ int i;
+
-+ for (i = 0; config->outputs[i] != NULL; ++i)
-+ output_free (config->outputs[i]);
++ for (i = 0; outputs[i] != NULL; ++i)
++ output_free (outputs[i]);
++}
++
++void
++configuration_free (Configuration *config)
++{
++ outputs_free (config->outputs);
++
++ g_free (config);
+}
+
+static void
@@ -2136,20 +2191,65 @@
+ return TRUE;
+}
+
++static Output **
++make_outputs (Configuration *config)
++{
++ GPtrArray *outputs;
++ Output *first_on;;
++ int i;
++
++ outputs = g_ptr_array_new ();
++
++ first_on = NULL;
++
++ for (i = 0; config->outputs[i] != NULL; ++i)
++ {
++ Output *old = config->outputs[i];
++ Output *new = output_copy (old);
++
++ if (old->on && !first_on)
++ first_on = old;
++
++ if (config->clone && new->on)
++ {
++ g_assert (first_on);
++
++ new->width = first_on->width;
++ new->height = first_on->height;
++ new->rotation = first_on->rotation;
++ new->x = 0;
++ new->y = 0;
++ }
++
++ g_ptr_array_add (outputs, new);
++ }
++
++ g_ptr_array_add (outputs, NULL);
++
++ return (Output **)g_ptr_array_free (outputs, FALSE);
++}
++
+gboolean
-+configuration_applicable (Configuration *configuration,
-+ RWScreen *screen)
++configuration_applicable (Configuration *configuration,
++ RWScreen *screen)
+{
-+ CrtcAssignment *assign = crtc_assignment_new (screen, configuration->outputs);
++ Output **outputs = make_outputs (configuration);
++ CrtcAssignment *assign = crtc_assignment_new (screen, outputs);
++ gboolean result;
+
+ if (assign)
+ {
++ result = TRUE;
+ crtc_assignment_free (assign);
-+
-+ return TRUE;
++ }
++ else
++ {
++ result = FALSE;
+ }
+
-+ return FALSE;
++ outputs_free (outputs);
++
++ return result;
+}
+
+static Configuration *
@@ -2231,6 +2331,8 @@
+ int j;
+
+ g_string_append_printf (string, "<configuration>\n");
++
++ g_string_append_printf (string, " <clone>%s</clone>\n", yes_no (config->clone));
+
+ for (j = 0; config->outputs[j] != NULL; ++j)
+ {
@@ -2290,7 +2392,7 @@
+ {
+ Output *output = config->outputs[i];
+
-+ if (output->connected)
++ if (output->on)
+ {
+ x_offset = MIN (x_offset, output->x);
+ y_offset = MIN (y_offset, output->y);
@@ -2301,14 +2403,12 @@
+ {
+ Output *output = config->outputs[i];
+
-+ if (output->connected)
++ if (output->on)
+ {
+ output->x -= x_offset;
+ output->y -= y_offset;
+ }
+ }
-+
-+ g_print ("Offsetting by %d %d\n", x_offset, y_offset);
+}
+
+gboolean
@@ -2340,14 +2440,15 @@
+apply_configuration (Configuration *conf, RWScreen *screen)
+{
+ CrtcAssignment *assignment;
-+ GTimer *timer;
++ Output **outputs;
+
-+ timer = g_timer_new ();
++ g_print ("applying configuration. Clone: %s\n", yes_no (conf->clone));
+
-+ assignment = crtc_assignment_new (screen, conf->outputs);
++ outputs = make_outputs (conf);
++
++ assignment = crtc_assignment_new (screen, outputs);
+
-+ g_print ("Computed CRTC assignment in %.2f ms\n",
-+ 1000 * g_timer_elapsed (timer, NULL));
++ outputs_free (outputs);
+
+ if (assignment)
+ {
@@ -2388,7 +2489,6 @@
+ else
+ {
+ result = FALSE;
-+ g_print ("Not found\n");
+ }
+
+ configurations_free (configs);
@@ -2522,7 +2622,6 @@
+{
+ RWCrtc *crtc = key;
+ CrtcInfo *info = value;
-+ GTimer *timer = g_timer_new ();
+
+ g_print ("Configuring crtc %x with ", rw_crtc_get_id (crtc));
+
@@ -2550,14 +2649,12 @@
+ (RWOutput **)info->outputs->pdata,
+ info->outputs->len))
+ {
-+ g_print ("succeeded");
++ g_print ("succeeded\n");
+ }
+ else
+ {
-+ g_print ("failed");
++ g_print ("failed\n");
+ }
-+
-+ g_print (" in %f seconds\n", g_timer_elapsed (timer, NULL));
+}
+
+static gboolean
@@ -2593,9 +2690,9 @@
+ RWCrtc **all_crtcs = rw_screen_list_crtcs (assign->screen);
+ GList *list;
+ int width, height;
-+ GTimer *timer;
+ int i;
+ int min_width, max_width, min_height, max_height;
++ int width_mm, height_mm;
+
+ /* Compute size of the screen */
+ width = height = 1;
@@ -2664,31 +2761,19 @@
+ rw_crtc_set_config (crtc, 0, 0, NULL, RW_ROTATION_0, NULL, 0);
+ }
+
-+ /* FIXME: What do we do about physical size?
++ /* The 'physical size' of an X screen is meaningless if that screen
++ * can consist of many monitors. So just pick a size that make the
++ * dpi 96.
+ *
-+ * As far as this function is concerned, probably just pass the problem up to
-+ * the callers. There, the best possibility might be to pick the sum of
-+ * physical sizes, but the reality is that the physical size of an X screen is
-+ * a meaningless concept in a randr 1.2 world.
++ * Firefox apparently believes what X tells it. It is a foolish
++ * application.
+ */
-+ timer = g_timer_new ();
-+ g_print ("setting size to %d %d\n", width, height);
++ width_mm = (width * 96.0) * 25.4;
++ height_mm = (height * 96.0) * 25.4;
+
-+ rw_screen_set_size (assign->screen, width, height, 300, 230);
++ rw_screen_set_size (assign->screen, width, height, width_mm, height_mm);
+
-+ gdk_flush ();
-+
-+ g_print ("time to set screen size: %f\n", g_timer_elapsed (timer, NULL));
-+
-+ g_timer_reset (timer);
-+
+ g_hash_table_foreach (assign->info, configure_crtc, NULL);
-+
-+ gdk_flush ();
-+
-+ g_print ("time to configure crtc's: %f\n", g_timer_elapsed (timer, NULL));
-+
-+ g_timer_destroy (timer);
+}
+
+/* Check whether the given set of settings can be used
@@ -2716,47 +2801,42 @@
+ {
+ return real_assign_crtcs (screen, outputs + 1, assignment);
+ }
-+
++
+ for (i = 0; crtcs[i] != NULL; ++i)
+ {
-+ RWCrtc *crtc = crtcs[i];
-+ RWOutput *rw_output = rw_screen_get_output_by_name (screen, output->name);
-+ RWMode **modes = rw_output_list_modes (rw_output);
-+ int j;
++ int pass;
+
-+ for (j = 0; modes[j] != NULL; ++j)
++ /* Make two passses, one where frequencies must match, then
++ * one where they don't have to
++ */
++ for (pass = 0; pass < 2; ++pass)
+ {
-+ RWMode *mode = modes[j];
-+
-+ if (rw_mode_get_width (mode) == output->width &&
-+ rw_mode_get_height (mode) == output->height &&
-+ rw_mode_get_freq (mode) == output->rate)
++ RWCrtc *crtc = crtcs[i];
++ RWOutput *rw_output = rw_screen_get_output_by_name (screen, output->name);
++ RWMode **modes = rw_output_list_modes (rw_output);
++ int j;
++
++ for (j = 0; modes[j] != NULL; ++j)
+ {
-+ if (crtc_assignment_assign (
-+ assignment, crtc, modes[j],
-+ output->x, output->y,
-+ output->rotation,
-+ rw_output))
++ RWMode *mode = modes[j];
++
++ if (rw_mode_get_width (mode) == output->width &&
++ rw_mode_get_height (mode) == output->height &&
++ (pass == 1 || rw_mode_get_freq (mode) == output->rate))
+ {
-+ if (real_assign_crtcs (screen, outputs + 1, assignment))
-+ return TRUE;
-+
-+ crtc_assignment_unassign (assignment, crtc, rw_output);
++ if (crtc_assignment_assign (
++ assignment, crtc, modes[j],
++ output->x, output->y,
++ output->rotation,
++ rw_output))
++ {
++ if (real_assign_crtcs (screen, outputs + 1, assignment))
++ return TRUE;
++
++ crtc_assignment_unassign (assignment, crtc, rw_output);
++ }
+ }
+ }
-+#if 0
-+ else
-+ {
-+ g_print ("rejected %d x %d x %d for %s\n",
-+ rw_mode_get_width (mode),
-+ rw_mode_get_height (mode),
-+ rw_mode_get_freq (mode),
-+ output->name);
-+
-+ g_print ("desired: %d x %d x %d\n",
-+ output->width, output->height, output->rate);
-+ }
-+#endif
+ }
+ }
+
@@ -2793,7 +2873,7 @@
+}
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/edid-parse.c
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/edid-parse.c 2008-03-20 01:22:07.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/edid-parse.c 2008-04-05 12:33:34.000000000 -0400
@@ -0,0 +1,551 @@
+/*
+ * Copyright 2007 Red Hat, Inc.
@@ -3348,7 +3428,7 @@
+}
diff -up gnome-desktop-2.22.0/libgnome-desktop/Makefile.am.add-randr-12 gnome-desktop-2.22.0/libgnome-desktop/Makefile.am
--- gnome-desktop-2.22.0/libgnome-desktop/Makefile.am.add-randr-12 2008-03-10 16:44:42.000000000 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/Makefile.am 2008-03-20 01:19:38.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/Makefile.am 2008-04-03 14:24:06.000000000 -0400
@@ -20,7 +20,12 @@ libgnome_desktop_2_la_SOURCES = \
gnome-desktop-item.c \
gnome-ditem-edit.c \
@@ -3365,7 +3445,7 @@
$(XLIB_LIBS) \
diff -up /dev/null gnome-desktop-2.22.0/libgnome-desktop/edid.h
--- /dev/null 2008-03-16 00:14:46.954006998 -0400
-+++ gnome-desktop-2.22.0/libgnome-desktop/edid.h 2008-03-20 01:22:07.000000000 -0400
++++ gnome-desktop-2.22.0/libgnome-desktop/edid.h 2008-04-05 12:33:34.000000000 -0400
@@ -0,0 +1,170 @@
+typedef unsigned char uchar;
+typedef struct MonitorInfo MonitorInfo;
@@ -3539,7 +3619,7 @@
+ const MonitorInfo *info);
diff -up gnome-desktop-2.22.0/configure.in.add-randr-12 gnome-desktop-2.22.0/configure.in
--- gnome-desktop-2.22.0/configure.in.add-randr-12 2008-03-10 17:02:23.000000000 -0400
-+++ gnome-desktop-2.22.0/configure.in 2008-03-20 01:19:38.000000000 -0400
++++ gnome-desktop-2.22.0/configure.in 2008-04-03 14:24:06.000000000 -0400
@@ -51,10 +51,10 @@ AC_SUBST(GNOME_MICRO)
AC_SUBST(GNOME_DISTRIBUTOR)
AC_SUBST(GNOME_DATE)
Index: gnome-desktop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-desktop/devel/gnome-desktop.spec,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -r1.137 -r1.138
--- gnome-desktop.spec 4 Apr 2008 17:59:57 -0000 1.137
+++ gnome-desktop.spec 5 Apr 2008 16:40:52 -0000 1.138
@@ -12,7 +12,7 @@
Summary: Package containing code shared among gnome-panel, gnome-session, nautilus, etc
Name: gnome-desktop
Version: 2.22.0
-Release: 5%{?dist}
+Release: 6%{?dist}
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-desktop/2.22/%{name}-%{version}.tar.bz2
License: GPLv2+ and LGPLv2+
@@ -129,9 +129,13 @@
%doc %{_datadir}/gtk-doc/html/gnome-desktop/
%changelog
+* Tue Apr 5 2008 Soren Sandmann <sandmann at redhat.com> - 2.22.0-6
+- Update randr code
+
* Fri Apr 4 2008 Matthias Clasen <mclasen at redhat.com> - 2.22.0-5
- Fix some logic errors wrt to caching of slideshows that
may cause nautilus crashes
+
* Sat Mar 29 2008 Matthias Clasen <mclasen at redhat.com> - 2.22.0-4
- Handle slideshow start times in the future correctly
More information about the fedora-extras-commits
mailing list