Mercurial > sdl-ios-xcode
annotate include/SDL_main.h @ 4240:cb44bf8f8a0f SDL-1.2
Fixed bug #719
Mike Blaguszewski 2009-03-23 13:32:22 PDT
Patch to 1.2 HEAD that fixes the issue
Fixes bug in SDL 1.2.13 where clicking on an app's title bar to activate the
app, when cursor capturing is enabled, will cause the window to jump. This is
because SDL's handler for activate events calls a low-level Quartz function to
move the cursor. Calling this when the mouse is down in the title bar confuses
the WindowServer into thinking the title bar has been dragged. The patch defers
processing of activate events in this case.
The bottom line is that CGWarpMouseCursorPosition() is not safe to call when
the mouse in down in a window's title bar.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 23 Sep 2009 07:18:02 +0000 |
parents | 4c4113c2162c |
children |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
4159 | 3 Copyright (C) 1997-2009 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 9 |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1145
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
251
b8688cfdc232
Updated the headers with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
173
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifndef _SDL_main_h | |
24 #define _SDL_main_h | |
25 | |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
26 #include "SDL_stdinc.h" |
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
27 |
4217 | 28 /** @file SDL_main.h |
29 * Redefine main() on Win32 and MacOS so that it is called by winmain.c | |
30 */ | |
0 | 31 |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
32 #if defined(__WIN32__) || \ |
453
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
371
diff
changeset
|
33 (defined(__MWERKS__) && !defined(__BEOS__)) || \ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
34 defined(__MACOS__) || defined(__MACOSX__) || \ |
453
a6fa62b1be09
Updated for embedded Visual C++ 4.0
Sam Lantinga <slouken@libsdl.org>
parents:
371
diff
changeset
|
35 defined(__SYMBIAN32__) || defined(QWS) |
0 | 36 |
37 #ifdef __cplusplus | |
38 #define C_LINKAGE "C" | |
39 #else | |
40 #define C_LINKAGE | |
41 #endif /* __cplusplus */ | |
42 | |
4217 | 43 /** The application's main() function must be called with C linkage, |
44 * and should be declared like this: | |
45 * @code | |
46 * #ifdef __cplusplus | |
47 * extern "C" | |
48 * #endif | |
49 * int main(int argc, char *argv[]) | |
50 * { | |
51 * } | |
52 * @endcode | |
0 | 53 */ |
54 #define main SDL_main | |
55 | |
4217 | 56 /** The prototype for the application's main() function */ |
0 | 57 extern C_LINKAGE int SDL_main(int argc, char *argv[]); |
58 | |
59 | |
4217 | 60 /** @name From the SDL library code -- needed for registering the app on Win32 */ |
61 /*@{*/ | |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
62 #ifdef __WIN32__ |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
63 |
0 | 64 #include "begin_code.h" |
65 #ifdef __cplusplus | |
66 extern "C" { | |
67 #endif | |
68 | |
4217 | 69 /** This should be called from your WinMain() function, if any */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
70 extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); |
4217 | 71 /** This can also be called, but is no longer necessary */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
72 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); |
4217 | 73 /** This can also be called, but is no longer necessary (SDL_Quit calls it) */ |
1466
3c45c578d480
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1402
diff
changeset
|
74 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); |
0 | 75 #ifdef __cplusplus |
76 } | |
77 #endif | |
78 #include "close_code.h" | |
79 #endif | |
4217 | 80 /*@}*/ |
0 | 81 |
4217 | 82 /** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ |
83 /*@{*/ | |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1356
diff
changeset
|
84 #if defined(__MACOS__) |
1356
67114343400d
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
1312
diff
changeset
|
85 |
0 | 86 #include "begin_code.h" |
87 #ifdef __cplusplus | |
88 extern "C" { | |
89 #endif | |
90 | |
4217 | 91 /** Forward declaration so we don't need to include QuickDraw.h */ |
0 | 92 struct QDGlobals; |
93 | |
4217 | 94 /** This should be called from your main() function, if any */ |
337
9154ec9ca3d2
Explicitly specify the SDL API calling convention (C by default)
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
95 extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); |
0 | 96 |
97 #ifdef __cplusplus | |
98 } | |
99 #endif | |
100 #include "close_code.h" | |
101 #endif | |
4217 | 102 /*@}*/ |
0 | 103 |
104 #endif /* Need to redefine main()? */ | |
105 | |
106 #endif /* _SDL_main_h */ |