Skip to content
Permalink
Browse files

Fixed bug #437

Some X servers advertise the DGA extension don't support DGA1 anymore.
  • Loading branch information
slouken committed Jul 8, 2007
1 parent 34900d1 commit 612e9b9c61d799cb041ad5ac6b63405599cabb7c
Showing with 29 additions and 26 deletions.
  1. +3 −0 docs.html
  2. +0 −3 src/video/dga/SDL_dgaevents.c
  3. +26 −23 src/video/x11/SDL_x11dga.c
@@ -61,6 +61,9 @@ <H3> General Notes </H3>
<H3> Unix Notes </H3>

<BLOCKQUOTE>
<P>
Fixed detection of X11 DGA mouse support.
</P>
<P>
Improved XIM support for asian character sets.
</P>
@@ -129,9 +129,6 @@ printf("KeyRelease (X11 keycode = 0x%X)\n", xkey.keycode);
posted = SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
}
break;

break;

}
return(posted);
}
@@ -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 @@ int dga_event, dga_error = -1;
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);
}
/* Check for buggy X servers */
if ( use_dgamouse && BUGGY_XFREE86(==, 4000) ) {
use_dgamouse = 0;
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;
}
}
/* 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_EnableDGAMouse(_THIS)
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
}

0 comments on commit 612e9b9

Please sign in to comment.