Mercurial > sdl-ios-xcode
annotate docs/html/guidethebasics.html @ 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 | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >The Basics</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="UP" | |
13 TITLE="SDL Guide" | |
14 HREF="guide.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="Credits" | |
17 HREF="guidecredits.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="Initializing SDL" | |
20 HREF="guidebasicsinit.html"></HEAD | |
21 ><BODY | |
22 CLASS="CHAPTER" | |
23 BGCOLOR="#FFF8DC" | |
24 TEXT="#000000" | |
25 LINK="#0000ee" | |
26 VLINK="#551a8b" | |
27 ALINK="#ff0000" | |
28 ><DIV | |
29 CLASS="NAVHEADER" | |
30 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
31 SUMMARY="Header navigation table" |
0 | 32 WIDTH="100%" |
33 BORDER="0" | |
34 CELLPADDING="0" | |
35 CELLSPACING="0" | |
36 ><TR | |
37 ><TH | |
38 COLSPAN="3" | |
39 ALIGN="center" | |
40 >SDL Library Documentation</TH | |
41 ></TR | |
42 ><TR | |
43 ><TD | |
44 WIDTH="10%" | |
45 ALIGN="left" | |
46 VALIGN="bottom" | |
47 ><A | |
48 HREF="guidecredits.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
49 ACCESSKEY="P" |
0 | 50 >Prev</A |
51 ></TD | |
52 ><TD | |
53 WIDTH="80%" | |
54 ALIGN="center" | |
55 VALIGN="bottom" | |
56 ></TD | |
57 ><TD | |
58 WIDTH="10%" | |
59 ALIGN="right" | |
60 VALIGN="bottom" | |
61 ><A | |
62 HREF="guidebasicsinit.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
63 ACCESSKEY="N" |
0 | 64 >Next</A |
65 ></TD | |
66 ></TR | |
67 ></TABLE | |
68 ><HR | |
69 ALIGN="LEFT" | |
70 WIDTH="100%"></DIV | |
71 ><DIV | |
72 CLASS="CHAPTER" | |
73 ><H1 | |
74 ><A | |
75 NAME="GUIDETHEBASICS" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
76 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
77 >Chapter 1. The Basics</H1 |
0 | 78 ><DIV |
79 CLASS="TOC" | |
80 ><DL | |
81 ><DT | |
82 ><B | |
83 >Table of Contents</B | |
84 ></DT | |
85 ><DT | |
86 ><A | |
87 HREF="guidethebasics.html#GUIDEINTRODUCTION" | |
88 >Introduction</A | |
89 ></DT | |
90 ><DT | |
91 ><A | |
92 HREF="guidebasicsinit.html" | |
93 >Initializing SDL</A | |
94 ></DT | |
95 ></DL | |
96 ></DIV | |
97 ><DIV | |
98 CLASS="SECT1" | |
99 ><H1 | |
100 CLASS="SECT1" | |
101 ><A | |
102 NAME="GUIDEINTRODUCTION" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
103 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
104 >Introduction</H1 |
0 | 105 ><P |
106 >The SDL Guide section is pretty incomplete. If you feel you have anything to add mail akawaka@skynet.ie or visit http://akawaka.csn.ul.ie/tne/.</P | |
107 ></DIV | |
108 ></DIV | |
109 ><DIV | |
110 CLASS="NAVFOOTER" | |
111 ><HR | |
112 ALIGN="LEFT" | |
113 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
114 SUMMARY="Footer navigation table" |
0 | 115 WIDTH="100%" |
116 BORDER="0" | |
117 CELLPADDING="0" | |
118 CELLSPACING="0" | |
119 ><TR | |
120 ><TD | |
121 WIDTH="33%" | |
122 ALIGN="left" | |
123 VALIGN="top" | |
124 ><A | |
125 HREF="guidecredits.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
126 ACCESSKEY="P" |
0 | 127 >Prev</A |
128 ></TD | |
129 ><TD | |
130 WIDTH="34%" | |
131 ALIGN="center" | |
132 VALIGN="top" | |
133 ><A | |
134 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
135 ACCESSKEY="H" |
0 | 136 >Home</A |
137 ></TD | |
138 ><TD | |
139 WIDTH="33%" | |
140 ALIGN="right" | |
141 VALIGN="top" | |
142 ><A | |
143 HREF="guidebasicsinit.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
144 ACCESSKEY="N" |
0 | 145 >Next</A |
146 ></TD | |
147 ></TR | |
148 ><TR | |
149 ><TD | |
150 WIDTH="33%" | |
151 ALIGN="left" | |
152 VALIGN="top" | |
153 >Credits</TD | |
154 ><TD | |
155 WIDTH="34%" | |
156 ALIGN="center" | |
157 VALIGN="top" | |
158 ><A | |
159 HREF="guide.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
160 ACCESSKEY="U" |
0 | 161 >Up</A |
162 ></TD | |
163 ><TD | |
164 WIDTH="33%" | |
165 ALIGN="right" | |
166 VALIGN="top" | |
167 >Initializing SDL</TD | |
168 ></TR | |
169 ></TABLE | |
170 ></DIV | |
171 ></BODY | |
172 ></HTML | |
173 > |