annotate src/video/xbios/SDL_xbios_tveille.h @ 4393:9afe12fb4c41 SDL-1.2

Fixed bug #901 Tim Angus 2009-12-11 11:45:46 PST Disable mouse event generation when state is not SDL_APPMOUSEFOCUS If a Windows SDL application is minimised by using alt-tab, SDL_APPMOUSEFOCUS is lost as part of the minimisation. Unfortunately, the directx driver doesn't pay any attention to this state when generating mouse button events, so clicking on the Desktop can cause mouse clicks in the SDL application, while it's still minimised. The attached patch fixes this. It looks much more complicated than it actually is due to indentation; here it is ignoring whitespace: tma@abraxas:~/sources/SDL-1.2-svn$ svn diff -x -b Index: src/video/windx5/SDL_dx5events.c =================================================================== --- src/video/windx5/SDL_dx5events.c (revision 5376) +++ src/video/windx5/SDL_dx5events.c (working copy) @@ -374,10 +374,9 @@ if ( !(SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { mouse_lost = 1; ClipCursor(NULL); - } - + } else { /* If the mouse was lost, regain some sense of mouse state */ - if ( mouse_lost && (SDL_GetAppState() & SDL_APPMOUSEFOCUS) ) { + if ( mouse_lost ) { POINT mouse_pos; Uint8 old_state; Uint8 new_state; @@ -548,6 +547,7 @@ if ( xrel || yrel ) { post_mouse_motion(1, xrel, yrel); } + } } /* The main Win32 event handler */
author Sam Lantinga <slouken@libsdl.org>
date Mon, 14 Dec 2009 22:41:31 +0000
parents a1b03ba2fcd0
children
rev   line source
3904
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
1 /*
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
4159
a1b03ba2fcd0 Updated copyright date
Sam Lantinga <slouken@libsdl.org>
parents: 3904
diff changeset
3 Copyright (C) 1997-2009 Sam Lantinga
3904
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
4
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
6 modify it under the terms of the GNU Library General Public
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
8 version 2 of the License, or (at your option) any later version.
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
9
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
13 Library General Public License for more details.
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
14
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
15 You should have received a copy of the GNU Library General Public
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
16 License along with this library; if not, write to the Free
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
18
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
19 Sam Lantinga
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
20 slouken@libsdl.org
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
21 */
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
22 #include "SDL_config.h"
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
23
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
24 /*
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
25 Turbo veille screensaver
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
26
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
27 Patrice Mandin
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
28 */
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
29
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
30 #ifndef _SDL_xbios_tveille_h
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
31 #define _SDL_xbios_tveille_h
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
32
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
33 #include "SDL_xbios.h"
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
34
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
35 /*--- Defines ---*/
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
36
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
37 #ifndef C_VeiL
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
38 #define C_VeiL 0x5665694CL
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
39 #endif
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
40
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
41 /*--- Structures ---*/
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
42
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
43 typedef struct {
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
44 unsigned long version;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
45 void (*prg_ptr)();
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
46 void (*kbd_ptr)();
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
47 void (*vbl_ptr)();
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
48 unsigned long vbl_count;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
49 void (*oldkbd_ptr)();
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
50 unsigned long off_count;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
51 unsigned long prg_size;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
52 unsigned long dummy1[4];
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
53 unsigned char dummy2;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
54 unsigned char status;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
55 unsigned short freq;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
56 unsigned short dummy3;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
57 unsigned char clear_first;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
58 unsigned char enabled; /* 0=enabled, 0xff=disabled */
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
59 unsigned char serial_redir;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
60 unsigned char dummy4;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
61 void (*oldserial_ptr)();
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
62 } __attribute__((packed)) tveille_t;
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
63
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
64 /*--- Functions prototypes ---*/
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
65
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
66 int SDL_XBIOS_TveillePresent(_THIS);
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
67 void SDL_XBIOS_TveilleDisable(_THIS);
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
68 void SDL_XBIOS_TveilleEnable(_THIS);
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
69
d8371d2dc524 Disable TurboVeille screensaver if present
Patrice Mandin <patmandin@gmail.com>
parents:
diff changeset
70 #endif /* _SDL_xbios_tveille_h */