You are not logged in.

#1 2014-07-29 00:03:54

David López
Member
Registered: 2012-08-26
Posts: 98

What does SDL_VIDEO_X11_DGAMOUSE=0 do?

Hi. I use archlinux with lxde in a tablet and I have issues when playing some games in fullscreen mode. I've tested several games with scummvm that work fine in windowed mode but the pointer seems to be crazy in fullscreen mode.

I've searched for my problem and I've found a suggestion:

export SDL_VIDEO_X11_DGAMOUSE=0

I've tested and it seems to work. However I haven't found information about what this option really does, and if it's safe to use in windowed mode (I'm thinking in autostart this option). Does anybody know what it means?

Offline

#2 2014-07-29 00:18:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Offline

#3 2014-07-29 23:37:59

David López
Member
Registered: 2012-08-26
Posts: 98

Re: What does SDL_VIDEO_X11_DGAMOUSE=0 do?

Thanks karol. I don't understand all, but now I get a better idea. I won't include that option in autostart, I'm not sure if it can interfere with some steam games. I'll start scummvm with

SDL_VIDEO_X11_DGAMOUSE=0 scummvm

Offline

#4 2014-07-30 08:20:22

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: What does SDL_VIDEO_X11_DGAMOUSE=0 do?

Take a look at the source code, in SDL-1.2.15, src/video/x11/SDL_x11mouse.c, here's snippets:

void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
{
    if ( using_dga & DGA_MOUSE ) {
        SDL_PrivateMouseMotion(0, 0, x, y);
    } else if ( mouse_relative) {
        /*  RJR: March 28, 2000
            leave physical cursor at center of screen if
            mouse hidden and grabbed */
        SDL_PrivateMouseMotion(0, 0, x, y);
    } else {
        SDL_Lock_EventThread();
        XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
        XSync(SDL_Display, False);
        SDL_Unlock_EventThread();
    }
}


    /* If the mouse is hidden and input is grabbed, we use relative mode */
    if ( enable_relative &&
         !(SDL_cursorstate & CURSOR_VISIBLE) &&
         (this->input_grab != SDL_GRAB_OFF) &&
             (SDL_GetAppState() & full_focus) == full_focus ) {
        if ( ! mouse_relative ) {
            X11_EnableDGAMouse(this);
            if ( ! (using_dga & DGA_MOUSE) ) {
                char *xmouse_accel;

                SDL_GetMouseState(&mouse_last.x, &mouse_last.y);
                /* Use as raw mouse mickeys as possible */
                XGetPointerControl(SDL_Display,
                        &mouse_accel.numerator,
                        &mouse_accel.denominator,
                        &mouse_accel.threshold);
                xmouse_accel=SDL_getenv("SDL_VIDEO_X11_MOUSEACCEL");
                if ( xmouse_accel ) {
                    SetMouseAccel(this, xmouse_accel);
                }
            }
            mouse_relative = 1;
        }
    } else {
        if ( mouse_relative ) {
            if ( using_dga & DGA_MOUSE ) {
                X11_DisableDGAMouse(this);
            } else {
                XChangePointerControl(SDL_Display, True, True,
                        mouse_accel.numerator,
                        mouse_accel.denominator,
                        mouse_accel.threshold);
            }
            mouse_relative = 0;
        }
    }

I have in my /etc/profile.d/nvidia.rc:

export SDL_VIDEO_X11_DGAMOUSE=0

I don't think there's ever an advantage in having it turned on, with nvidia.

Further evidence, in Nvidia's README:

Q. Why do applications that use DGA graphics fail?

A. The NVIDIA driver does not support the graphics component of the
   XFree86-DGA (Direct Graphics Access) extension. Applications can use the
   XDGASelectInput() function to acquire relative pointer motion, but
   graphics-related functions such as XDGASetMode() and XDGAOpenFramebuffer()
   will fail.

I also have, in /usr/share/X11/xorg.conf.d/50-nvidia.conf:

Section "Module"
    SubSection "extmod"
        # Don't initialize the DGA extension
        Option "omit xfree86-dga"
    EndSubSection
EndSection

Offline

Board footer

Powered by FluxBB