diff -Nur gdm-2.20.0/gui/gdmcommon.c gdm-2.20.0.new/gui/gdmcommon.c --- gdm-2.20.0/gui/gdmcommon.c 2007-10-15 01:07:16.000000000 +0100 +++ gdm-2.20.0.new/gui/gdmcommon.c 2007-10-15 01:08:55.000000000 +0100 @@ -37,6 +37,7 @@ #include #include #include +#include #include "gdm.h" #include "gdmcommon.h" @@ -200,6 +201,52 @@ } void +gdm_common_setup_xrandr () +{ + XRRScreenResources *res; + XRROutputInfo *output_info; + XRRScreenConfiguration *sc; + Rotation current_rotation; + Display *dpy = XOpenDisplay (gdk_get_display()); + Window root = RootWindow (dpy, DefaultScreen (dpy)); + + res = XRRGetScreenResources (dpy, root); + + if (!res) + goto out; + + if (res->noutput > 1) + goto out_resources; + + output_info = XRRGetOutputInfo (dpy, res, res->outputs[0]); + + if (!output_info) + goto out_resources; + + if (strcmp (output_info->name, "default")) + goto out_outputinfo; + + /* So it looks like we have a randr1.0 driver */ + + sc = XRRGetScreenInfo (dpy, root); + + if (!sc) + goto out_outputinfo; + + XRRConfigRotations (sc, ¤t_rotation); + + XRRSetScreenConfig (dpy, sc, root, 0, current_rotation, CurrentTime); + + XRRFreeScreenConfigInfo (sc); + out_outputinfo: + XRRFreeOutputInfo (output_info); + out_resources: + XRRFreeScreenResources (res); + out: + XCloseDisplay (dpy); +} + +void gdm_common_setup_cursor (GdkCursorType type) { GdkCursor *cursor = gdk_cursor_new (type); diff -Nur gdm-2.20.0/gui/gdmcommon.h gdm-2.20.0.new/gui/gdmcommon.h --- gdm-2.20.0/gui/gdmcommon.h 2007-09-17 15:45:38.000000000 +0100 +++ gdm-2.20.0.new/gui/gdmcommon.h 2007-10-15 01:07:17.000000000 +0100 @@ -45,6 +45,7 @@ G_GNUC_PRINTF (1, 2); /* Misc. Common Functions */ +void gdm_common_setup_xrandr (void); void gdm_common_setup_cursor (GdkCursorType type); void gdm_common_setup_builtin_icons (void); diff -Nur gdm-2.20.0/gui/greeter/greeter.c gdm-2.20.0.new/gui/greeter/greeter.c --- gdm-2.20.0/gui/greeter/greeter.c 2007-10-15 01:07:15.000000000 +0100 +++ gdm-2.20.0.new/gui/greeter/greeter.c 2007-10-15 01:07:17.000000000 +0100 @@ -1294,6 +1294,8 @@ gtk_init (&argc, &argv); + gdm_common_setup_xrandr (); + gdm_common_setup_cursor (GDK_WATCH); gdm_common_log_init ();