src/video/x11/SDL_x11modes.c
branchSDL-1.2
changeset 4154 db4007f17bc8
parent 1863 0e44c6f90b95
child 4159 a1b03ba2fcd0
--- a/src/video/x11/SDL_x11modes.c	Mon Sep 15 05:08:53 2008 +0000
+++ b/src/video/x11/SDL_x11modes.c	Mon Sep 15 20:47:55 2008 +0000
@@ -52,8 +52,25 @@
 #if SDL_VIDEO_DRIVER_X11_VIDMODE
 Bool SDL_NAME(XF86VidModeGetModeInfo)(Display *dpy, int scr, SDL_NAME(XF86VidModeModeInfo) *info)
 {
-    SDL_NAME(XF86VidModeModeLine) *l = (SDL_NAME(XF86VidModeModeLine)*)((char*)info + sizeof info->dotclock);
-    return SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, (int*)&info->dotclock, l);
+    Bool retval;
+    int dotclock;
+    SDL_NAME(XF86VidModeModeLine) l;
+    SDL_memset(&l, 0, sizeof(l));
+    retval = SDL_NAME(XF86VidModeGetModeLine)(dpy, scr, &dotclock, &l);
+    info->dotclock = dotclock;
+    info->hdisplay = l.hdisplay;
+    info->hsyncstart = l.hsyncstart;
+    info->hsyncend = l.hsyncend;
+    info->htotal = l.htotal;
+    info->hskew = l.hskew;
+    info->vdisplay = l.vdisplay;
+    info->vsyncstart = l.vsyncstart;
+    info->vsyncend = l.vsyncend;
+    info->vtotal = l.vtotal;
+    info->flags = l.flags;
+    info->privsize = l.privsize;
+    info->private = l.private;
+    return retval;
 }
 #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */