# HG changeset patch # User Sam Lantinga # Date 1183927116 0 # Node ID cbad710a65094c11cc894812357b87e2132eec22 # Parent 33d34b7ce689ca557e852ae704774831e8fa3197 Fixed bug #437 Some X servers advertise the DGA extension don't support DGA1 anymore. diff -r 33d34b7ce689 -r cbad710a6509 docs.html --- a/docs.html Sun Jul 08 14:24:27 2007 +0000 +++ b/docs.html Sun Jul 08 20:38:36 2007 +0000 @@ -62,6 +62,9 @@

+ Fixed detection of X11 DGA mouse support. +

+

Improved XIM support for asian character sets.

diff -r 33d34b7ce689 -r cbad710a6509 src/video/dga/SDL_dgaevents.c --- a/src/video/dga/SDL_dgaevents.c Sun Jul 08 14:24:27 2007 +0000 +++ b/src/video/dga/SDL_dgaevents.c Sun Jul 08 20:38:36 2007 +0000 @@ -129,9 +129,6 @@ posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym); } break; - - break; - } return(posted); } diff -r 33d34b7ce689 -r cbad710a6509 src/video/x11/SDL_x11dga.c --- a/src/video/x11/SDL_x11dga.c Sun Jul 08 14:24:27 2007 +0000 +++ b/src/video/x11/SDL_x11dga.c Sun Jul 08 20:38:36 2007 +0000 @@ -22,8 +22,7 @@ #include "SDL_config.h" /* This is currently only used to enable DGA mouse. - The new fullscreen code makes it very difficult to handle DGA dynamically. - There will be a completely separate DGA driver that is fullscreen-only. + There is a completely separate DGA driver that is fullscreen-only. */ #include "SDL_video.h" @@ -36,24 +35,33 @@ void X11_EnableDGAMouse(_THIS) { #if SDL_VIDEO_DRIVER_X11_DGAMOUSE - int dga_major, dga_minor; - int use_dgamouse; - const char *env_use_dgamouse; + static int use_dgamouse = -1; /* Check configuration to see if we should use DGA mouse */ - use_dgamouse = 1; - env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); - if ( env_use_dgamouse ) { - use_dgamouse = atoi(env_use_dgamouse); + if ( use_dgamouse < 0 ) { + int dga_major, dga_minor; + int dga_flags; + const char *env_use_dgamouse; + + use_dgamouse = 1; + env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); + if ( env_use_dgamouse ) { + use_dgamouse = SDL_atoi(env_use_dgamouse); + } + /* Check for buggy X servers */ + if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) { + use_dgamouse = 0; + } + if ( !use_dgamouse || !local_X11 || + !SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) || + !SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) || + !SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &dga_flags) || + !(dga_flags & XF86DGADirectPresent) ) { + use_dgamouse = 0; + } } - /* Check for buggy X servers */ - if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) { - use_dgamouse = 0; - } - /* Only use DGA mouse if the cursor is not showing (in relative mode) */ - if ( use_dgamouse && local_X11 && !(using_dga & DGA_MOUSE) && - SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) && - SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ) { + + if ( use_dgamouse && !(using_dga & DGA_MOUSE) ) { if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) { using_dga |= DGA_MOUSE; } @@ -65,13 +73,8 @@ void X11_CheckDGAMouse(_THIS) { #if SDL_VIDEO_DRIVER_X11_DGAMOUSE - int flags; - if ( using_dga & DGA_MOUSE ) { - SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &flags); - if ( ! (flags & XF86DGADirectMouse) ) { - SDL_NAME(XF86DGADirectVideo)(SDL_Display,SDL_Screen,XF86DGADirectMouse); - } + SDL_NAME(XF86DGADirectVideo)(SDL_Display,SDL_Screen,XF86DGADirectMouse); } #endif }