comparison src/video/x11/SDL_x11mouse.c @ 527:5c74ac147358

Fixed mouse warp position bug with offset video modes
author Sam Lantinga <slouken@libsdl.org>
date Fri, 11 Oct 2002 08:09:26 +0000
parents f6ffac90895c
children b8d311d90021
comparison
equal deleted inserted replaced
526:4314a501d7be 527:5c74ac147358
175 } 175 }
176 176
177 void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y) 177 void X11_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
178 { 178 {
179 if ( using_dga & DGA_MOUSE ) { 179 if ( using_dga & DGA_MOUSE ) {
180 x += (this->screen->offset % this->screen->pitch) / 180 SDL_PrivateMouseMotion(0, 0, x, y);
181 this->screen->format->BytesPerPixel; 181 } else if ( mouse_relative) {
182 y += (this->screen->offset / this->screen->pitch); 182 /* RJR: March 28, 2000
183 leave physical cursor at center of screen if
184 mouse hidden and grabbed */
183 SDL_PrivateMouseMotion(0, 0, x, y); 185 SDL_PrivateMouseMotion(0, 0, x, y);
184 } else { 186 } else {
185 SDL_Lock_EventThread(); 187 SDL_Lock_EventThread();
186 XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y); 188 XWarpPointer(SDL_Display, None, SDL_Window, 0, 0, 0, 0, x, y);
187 XSync(SDL_Display, False); 189 XSync(SDL_Display, False);