Commit bd653f81 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #437

Some X servers advertise the DGA extension don't support DGA1 anymore.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402445
parent d3ad0e27
...@@ -61,6 +61,9 @@ SDL 1.2.12 is a minor bug fix release. ...@@ -61,6 +61,9 @@ SDL 1.2.12 is a minor bug fix release.
<H3> Unix Notes </H3> <H3> Unix Notes </H3>
<BLOCKQUOTE> <BLOCKQUOTE>
<P>
Fixed detection of X11 DGA mouse support.
</P>
<P> <P>
Improved XIM support for asian character sets. Improved XIM support for asian character sets.
</P> </P>
......
...@@ -129,9 +129,6 @@ printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode); ...@@ -129,9 +129,6 @@ printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode);
posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym); posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
} }
break; break;
break;
} }
return(posted); return(posted);
} }
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
#include "SDL_config.h" #include "SDL_config.h"
/* This is currently only used to enable DGA mouse. /* This is currently only used to enable DGA mouse.
The new fullscreen code makes it very difficult to handle DGA dynamically. There is a completely separate DGA driver that is fullscreen-only.
There will be a completely separate DGA driver that is fullscreen-only.
*/ */
#include "SDL_video.h" #include "SDL_video.h"
...@@ -36,24 +35,33 @@ int dga_event, dga_error = -1; ...@@ -36,24 +35,33 @@ int dga_event, dga_error = -1;
void X11_EnableDGAMouse(_THIS) void X11_EnableDGAMouse(_THIS)
{ {
#if SDL_VIDEO_DRIVER_X11_DGAMOUSE #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
static int use_dgamouse = -1;
/* Check configuration to see if we should use DGA mouse */
if ( use_dgamouse < 0 ) {
int dga_major, dga_minor; int dga_major, dga_minor;
int use_dgamouse; int dga_flags;
const char *env_use_dgamouse; const char *env_use_dgamouse;
/* Check configuration to see if we should use DGA mouse */
use_dgamouse = 1; use_dgamouse = 1;
env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE"); env_use_dgamouse = SDL_getenv("SDL_VIDEO_X11_DGAMOUSE");
if ( env_use_dgamouse ) { if ( env_use_dgamouse ) {
use_dgamouse = atoi(env_use_dgamouse); use_dgamouse = SDL_atoi(env_use_dgamouse);
} }
/* Check for buggy X servers */ /* Check for buggy X servers */
if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) { if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) {
use_dgamouse = 0; use_dgamouse = 0;
} }
/* Only use DGA mouse if the cursor is not showing (in relative mode) */ if ( !use_dgamouse || !local_X11 ||
if ( use_dgamouse && local_X11 && !(using_dga & DGA_MOUSE) && !SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) ||
SDL_NAME(XF86DGAQueryExtension)(SDL_Display, &dga_event, &dga_error) && !SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ||
SDL_NAME(XF86DGAQueryVersion)(SDL_Display, &dga_major, &dga_minor) ) { !SDL_NAME(XF86DGAQueryDirectVideo)(SDL_Display, SDL_Screen, &dga_flags) ||
!(dga_flags & XF86DGADirectPresent) ) {
use_dgamouse = 0;
}
}
if ( use_dgamouse && !(using_dga & DGA_MOUSE) ) {
if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) { if ( SDL_NAME(XF86DGADirectVideo)(SDL_Display, SDL_Screen, XF86DGADirectMouse) ) {
using_dga |= DGA_MOUSE; using_dga |= DGA_MOUSE;
} }
...@@ -65,14 +73,9 @@ void X11_EnableDGAMouse(_THIS) ...@@ -65,14 +73,9 @@ void X11_EnableDGAMouse(_THIS)
void X11_CheckDGAMouse(_THIS) void X11_CheckDGAMouse(_THIS)
{ {
#if SDL_VIDEO_DRIVER_X11_DGAMOUSE #if SDL_VIDEO_DRIVER_X11_DGAMOUSE
int flags;
if ( using_dga & DGA_MOUSE ) { 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 #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment