Mercurial > sdl-ios-xcode
annotate docs/html/sdlresizeevent.html @ 1629:ef4a796e7f24
Fixed bug #55
From Christian Walther:
When writing my patch for #12, I ended up doing all sorts of changes to the way
application/window activating/deactivating is handled in the Quartz backend,
resulting in the attached patch. It does make the code a bit cleaner IMHO, but
as it might be regarded as a case of "if it ain't broken, don't fix it" I'd
like to hear other people's opinion about it. Please shout if some change
strikes you as unnecessary or wrong, and I'll explain the reasons behind it. As
far as I tested it, it does not introduce any new bugs, but I may well have
missed some.
- The most fundamental change (that triggered most of the others) is irrelevant
for the usual single-window SDL applications, it only affects the people who
are crazy enough to display other Cocoa windows alongside the SDL window (I'm
actually doing this currently, although the additional window only displays
debugging info and won't be present in the final product): Before, some things
were done on the application becoming active, some on the window becoming key,
and some on the window becoming main. Conceptually, all these actions belong to
the window becoming key, so that's what I implemented. However, since in a
single-window application these three events always happen together, the
previous implementation "ain't broken".
- This slightly changed the meaning of the SDL_APPMOUSEFOCUS flag from
SDL_GetAppState(): Before, it meant "window is main and mouse is inside window
(or mode is fullscreen)". Now, it means "window is key and mouse is inside
window (or mode is fullscreen)". It makes more sense to me that way. (See
http://developer.apple.com/documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html
for a discussion of what key and main windows are.) The other two flags are
unchanged: SDL_APPACTIVE = application is not hidden and window is not
minimized, SDL_APPINPUTFOCUS = window is key (or mode is fullscreen).
- As a side effect, the reorganization fixes the following two issues (and
maybe others) (but they could also be fixed in less invasive ways):
* A regression that was introduced in revision 1.42 of SDL_QuartzVideo.m
(http://libsdl.org/cgi/cvsweb.cgi/SDL12/src/video/quartz/SDL_QuartzVideo.m.diff?r1=1.41&r2=1.42)
(from half-desirable to undesirable behavior):
Situation: While in windowed mode, hide the cursor using
SDL_ShowCursor(SDL_DISABLE), move the mouse outside of the window so that the
cursor becomes visible again, and SDL_SetVideoMode() to a fullscreen mode.
What happened before revision 1.42: The cursor is visible, but becomes
invisible as soon as the mouse is moved (half-desirable).
What happens in revision 1.42 and after (including current CVS): The cursor is
visible and stays visible (undesirable).
What happens after my patch: The cursor is invisible from the beginning
(desirable).
* When the cursor is hidden and grabbed, switch away from the application using
cmd-tab (which ungrabs and makes the cursor visible), move the cursor outside
of the SDL window, then cmd-tab back to the application. In 1.2.8 and in the
current CVS, the cursor is re-grabbed, but it stays visible (immovable in the
middle of the window). With my patch, the cursor is correctly re-grabbed and
hidden. (For some reason, it still doesn't work correctly if you switch back to
the application using the dock instead of cmd-tab. I haven't been able to
figure out why. I can step over [NSCursor hide] being called in the debugger,
but it seems to have no effect.)
- The patch includes my patch for #12 (it was easier to obtain using cvs diff
that way). If you apply both of them, you will end up with 6 duplicate lines in
SDL_QuartzEvents.m.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Apr 2006 14:17:48 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_ResizeEvent</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
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 Event Structures." | |
14 HREF="eventstructures.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_JoyBallEvent" | |
17 HREF="sdljoyballevent.html"><LINK | |
18 REL="NEXT" | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
19 TITLE="SDL_ExposeEvent" |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
20 HREF="sdlexposeevent.html"></HEAD |
0 | 21 ><BODY |
22 CLASS="REFENTRY" | |
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:
181
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="sdljoyballevent.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
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 | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
62 HREF="sdlexposeevent.html" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
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 ><H1 | |
72 ><A | |
73 NAME="SDLRESIZEEVENT" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
74 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
75 >SDL_ResizeEvent</H1 |
0 | 76 ><DIV |
77 CLASS="REFNAMEDIV" | |
78 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
79 NAME="AEN4453" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_ResizeEvent -- Window resize event structure</DIV | |
84 ><DIV | |
85 CLASS="REFSECT1" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN4456" |
0 | 88 ></A |
89 ><H2 | |
90 >Structure Definition</H2 | |
91 ><PRE | |
92 CLASS="PROGRAMLISTING" | |
93 >typedef struct{ | |
94 Uint8 type; | |
95 int w, h; | |
96 } SDL_ResizeEvent;</PRE | |
97 ></DIV | |
98 ><DIV | |
99 CLASS="REFSECT1" | |
100 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
101 NAME="AEN4459" |
0 | 102 ></A |
103 ><H2 | |
104 >Structure Data</H2 | |
105 ><DIV | |
106 CLASS="INFORMALTABLE" | |
107 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
108 NAME="AEN4461" |
0 | 109 ></A |
110 ><P | |
111 ></P | |
112 ><TABLE | |
113 BORDER="0" | |
114 CLASS="CALSTABLE" | |
115 ><TBODY | |
116 ><TR | |
117 ><TD | |
118 ALIGN="LEFT" | |
119 VALIGN="TOP" | |
120 ><TT | |
121 CLASS="STRUCTFIELD" | |
122 ><I | |
123 >type</I | |
124 ></TT | |
125 ></TD | |
126 ><TD | |
127 ALIGN="LEFT" | |
128 VALIGN="TOP" | |
129 ><TT | |
130 CLASS="LITERAL" | |
131 >SDL_VIDEORESIZE</TT | |
132 ></TD | |
133 ></TR | |
134 ><TR | |
135 ><TD | |
136 ALIGN="LEFT" | |
137 VALIGN="TOP" | |
138 ><TT | |
139 CLASS="STRUCTFIELD" | |
140 ><I | |
141 >w</I | |
142 ></TT | |
143 >, <TT | |
144 CLASS="STRUCTFIELD" | |
145 ><I | |
146 >h</I | |
147 ></TT | |
148 ></TD | |
149 ><TD | |
150 ALIGN="LEFT" | |
151 VALIGN="TOP" | |
152 >New width and height of the window</TD | |
153 ></TR | |
154 ></TBODY | |
155 ></TABLE | |
156 ><P | |
157 ></P | |
158 ></DIV | |
159 ></DIV | |
160 ><DIV | |
161 CLASS="REFSECT1" | |
162 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
163 NAME="AEN4474" |
0 | 164 ></A |
165 ><H2 | |
166 >Description</H2 | |
167 ><P | |
168 ><SPAN | |
169 CLASS="STRUCTNAME" | |
170 >SDL_ResizeEvent</SPAN | |
171 > is a member of the <A | |
172 HREF="sdlevent.html" | |
173 ><SPAN | |
174 CLASS="STRUCTNAME" | |
175 >SDL_Event</SPAN | |
176 ></A | |
177 > union and is used when an event of type <TT | |
178 CLASS="LITERAL" | |
179 >SDL_VIDEORESIZE</TT | |
180 > is reported.</P | |
181 ><P | |
182 >When <TT | |
183 CLASS="LITERAL" | |
184 >SDL_RESIZABLE</TT | |
185 > is passed as a <TT | |
186 CLASS="PARAMETER" | |
187 ><I | |
188 >flag</I | |
189 ></TT | |
190 > to <A | |
191 HREF="sdlsetvideomode.html" | |
192 ><TT | |
193 CLASS="FUNCTION" | |
194 >SDL_SetVideoMode</TT | |
195 ></A | |
196 > the user is allowed to resize the applications window. When the window is resized an <TT | |
197 CLASS="LITERAL" | |
198 >SDL_VIDEORESIZE</TT | |
199 > is report, with the new window width and height values stored in <TT | |
200 CLASS="STRUCTFIELD" | |
201 ><I | |
202 >w</I | |
203 ></TT | |
204 > and <TT | |
205 CLASS="STRUCTFIELD" | |
206 ><I | |
207 >h</I | |
208 ></TT | |
209 >, respectively. When an <TT | |
210 CLASS="LITERAL" | |
211 >SDL_VIDEORESIZE</TT | |
212 > is recieved the window should be resized to the new dimensions using <A | |
213 HREF="sdlsetvideomode.html" | |
214 ><TT | |
215 CLASS="FUNCTION" | |
216 >SDL_SetVideoMode</TT | |
217 ></A | |
218 >.</P | |
219 ></DIV | |
220 ><DIV | |
221 CLASS="REFSECT1" | |
222 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
223 NAME="AEN4492" |
0 | 224 ></A |
225 ><H2 | |
226 >See Also</H2 | |
227 ><P | |
228 ><A | |
229 HREF="sdlevent.html" | |
230 ><SPAN | |
231 CLASS="STRUCTNAME" | |
232 >SDL_Event</SPAN | |
233 ></A | |
234 >, | |
235 <A | |
236 HREF="sdlsetvideomode.html" | |
237 ><TT | |
238 CLASS="FUNCTION" | |
239 >SDL_SetVideoMode</TT | |
240 ></A | |
241 ></P | |
242 ></DIV | |
243 ><DIV | |
244 CLASS="NAVFOOTER" | |
245 ><HR | |
246 ALIGN="LEFT" | |
247 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
248 SUMMARY="Footer navigation table" |
0 | 249 WIDTH="100%" |
250 BORDER="0" | |
251 CELLPADDING="0" | |
252 CELLSPACING="0" | |
253 ><TR | |
254 ><TD | |
255 WIDTH="33%" | |
256 ALIGN="left" | |
257 VALIGN="top" | |
258 ><A | |
259 HREF="sdljoyballevent.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
260 ACCESSKEY="P" |
0 | 261 >Prev</A |
262 ></TD | |
263 ><TD | |
264 WIDTH="34%" | |
265 ALIGN="center" | |
266 VALIGN="top" | |
267 ><A | |
268 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
269 ACCESSKEY="H" |
0 | 270 >Home</A |
271 ></TD | |
272 ><TD | |
273 WIDTH="33%" | |
274 ALIGN="right" | |
275 VALIGN="top" | |
276 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
277 HREF="sdlexposeevent.html" |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
278 ACCESSKEY="N" |
0 | 279 >Next</A |
280 ></TD | |
281 ></TR | |
282 ><TR | |
283 ><TD | |
284 WIDTH="33%" | |
285 ALIGN="left" | |
286 VALIGN="top" | |
287 >SDL_JoyBallEvent</TD | |
288 ><TD | |
289 WIDTH="34%" | |
290 ALIGN="center" | |
291 VALIGN="top" | |
292 ><A | |
293 HREF="eventstructures.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
294 ACCESSKEY="U" |
0 | 295 >Up</A |
296 ></TD | |
297 ><TD | |
298 WIDTH="33%" | |
299 ALIGN="right" | |
300 VALIGN="top" | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
301 >SDL_ExposeEvent</TD |
0 | 302 ></TR |
303 ></TABLE | |
304 ></DIV | |
305 ></BODY | |
306 ></HTML | |
307 > |