[PATCH 9/15] gnome-control-center: Xrandr version checks
- From: Bryce Harrington <bryce canonical com>
- To: Soeren Sandmann <sandmann daimi au dk>
- Cc: ubuntu-x lists ubuntu com, gnomecc-list gnome org
- Subject: [PATCH 9/15] gnome-control-center: Xrandr version checks
- Date: Thu, 10 Apr 2008 12:59:43 -0700
gnome-control-center: 107_cc-randr12-check-version.patch (LP: #198951,
#199549)
Another xrandr 1.2 version check. Again, probably unnecessary on
Ubuntu/Fedora, but might be useful for GNOME generally. (Maybe it could
be handled at a more centralized location though.)
diff -Nur -x '*.orig' -x '*~' gnome-control-center-2.22.1/capplets/display/xrandr-capplet.c gnome-control-center-2.22.1.new/capplets/display/xrandr-capplet.c
--- gnome-control-center-2.22.1/capplets/display/xrandr-capplet.c 2008-04-09 11:02:39.000000000 +0100
+++ gnome-control-center-2.22.1.new/capplets/display/xrandr-capplet.c 2008-04-09 11:02:40.000000000 +0100
@@ -1516,6 +1516,10 @@
#define GLADE_FILE GNOMECC_GLADE_DIR "/display-capplet.glade"
GladeXML *xml;
GtkWidget *align;
+ int major, minor;
+ int event_base, error_base;
+ GdkDisplay *display;
+ Display *xdisplay;
xml = glade_xml_new (GLADE_FILE, NULL, NULL);
if (!xml)
@@ -1523,7 +1527,40 @@
g_warning ("Could not open " GLADE_FILE);
return;
}
-
+
+ display = gdk_display_get_default ();
+ xdisplay = gdk_x11_display_get_xdisplay (display);
+
+ if (!XRRQueryExtension (xdisplay, &event_base, &error_base) ||
+ XRRQueryVersion (xdisplay, &major, &minor) == 0)
+ {
+ GtkWidget *dialog = gtk_message_dialog_new (
+ NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "The X Server does not support the XRandR extension. Runtime resolution changes to the display size are not available."
+ );
+ gtk_window_set_title (GTK_WINDOW (dialog), "");
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ return;
+ }
+ else if (major != 1 || minor < 2)
+ {
+ GtkWidget *dialog = gtk_message_dialog_new (
+ NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "The version of the XRandR extension is incompatible with this program. Runtime changes to the display size are not available."
+ );
+ gtk_window_set_title (GTK_WINDOW (dialog), "");
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ return;
+ }
+
app->screen = rw_screen_new (gdk_screen_get_default(),
on_screen_changed, app);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]