xmame  

Re: [patch] DGA2.0 and Matrox G200

Shyouzou Sugitani
Fri, 01 Dec 2000 22:46:50 -0800


I forgot to include this patch in my previous one.
This makes xmame restore the mouse cursor position when exit from
the dga mode.

P.S.
Lawrence,
would you apply my ALSA sound driver patches to your source tree?

Enjoy.

--- src/unix/video-drivers/xf86_dga.c.dist      Fri Dec  1 23:04:34 2000
+++ src/unix/video-drivers/xf86_dga.c   Sat Dec  2 00:00:20 2000
@@ -55,7 +55,8 @@
        XF86VidModeModeInfo orig_mode;
        int vidmode_changed;
        int palette_dirty;
-} xf86ctx = {-1,NULL,FALSE,FALSE,FALSE,NULL,-1,-1,-1,0,NULL,{0},FALSE,FALSE};
+       int rpx, rpy;
+} xf86ctx = {-1,NULL,FALSE,FALSE,FALSE,NULL,-1,-1,-1,0,NULL,{0},FALSE,FALSE,0,0};
                
 static unsigned char *doublebuffer_buffer = NULL;
 
@@ -322,6 +323,8 @@
        int i, count;
        XPixmapFormatValues *pixmaps;
        XF86VidModeModeInfo *bestmode;
+       Window root, child;
+       int wpx, wpy, mask;
        /* only have todo the fork's the first time we go DGA, otherwise people
           who do a lott of dga <-> window switching will get a lott of
           children */
@@ -411,6 +414,9 @@
                        xf86ctx.grabbed_mouse = 1;
        }
 
+        XQueryPointer(display, window,
+                      &root, &child, &xf86ctx.rpx, &xf86ctx.rpy, &wpx, &wpy, &mask);
+
        XWarpPointer(display, None, window, 0, 0, 0, 0, 0, 0);
 
        if(first_time)
@@ -577,6 +583,7 @@
                XFreeColormap(display,xf86ctx.cmap);
                xf86ctx.cmap = 0;
        }
+       XWarpPointer(display, None, RootWindow(display,xf86ctx.screen), 0, 0, 0, 0, 
+xf86ctx.rpx, xf86ctx.rpy);
        if(xf86ctx.grabbed_mouse)
        {
                XUngrabPointer(display,CurrentTime);
----
Shyouzou Sugitani <[EMAIL PROTECTED]>
                  <[EMAIL PROTECTED]>
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]