1
2006-05-05 Gwenole Beauchesne <gb.public@free.fr>
3
* gtk/gtkaqua.c (gtk_aqua_draw_focus): Don't crash if "detail" is
6
* gdk/MacCarbonEvents.c (mouse_motion_handler): Another NULL
9
2006-04-17 Gwenole Beauchesne <gb.public@free.fr>
11
* glib-1.2.10/gmain.c (g_main_run): Don't block in
12
RunApplicationEventLoop(), code inspired from Inside Mac
15
This patch only suits Basilisk II needs. i.e. this may not work
18
2006-04-17 Gwenole Beauchesne <gb.public@free.fr>
20
* glib-1.2.10/glibconfig.h (G_VA_COPY): Don't redefine.
22
--- gtk-osx-0.7/gdk/MacCarbonEvents.c Sat May 8 16:59:12 2004
23
+++ gtk-osx-0.7/gdk/MacCarbonEvents.c Fri May 5 07:48:45 2006
24
@@ -227,7 +227,7 @@ mouse_motion_handler (EventHandlerCallRe
25
local_point.v = global_point.v;
28
- if (gdk_window != g_win_containing_mouse)
29
+ if (gdk_window && gdk_window != g_win_containing_mouse)
32
if(GDK_LEAVE_NOTIFY_MASK & ((GdkWindowPrivate*) g_win_containing_mouse)->event_mask) {
33
--- gtk-osx-0.7/glib-1.2.10/glibconfig.h Thu Jan 2 05:29:18 2003
34
+++ gtk-osx-0.7/glib-1.2.10/glibconfig.h Mon Apr 17 21:12:34 2006
35
@@ -62,8 +62,9 @@ G_GNUC_EXTENSION typedef unsigned long l
36
#define GLIB_MINOR_VERSION 2
37
#define GLIB_MICRO_VERSION 10
41
#define G_VA_COPY __va_copy
45
#define G_HAVE_INLINE 1
46
--- gtk-osx-0.7/glib-1.2.10/gmain.c Sat Dec 27 22:23:06 2003
47
+++ gtk-osx-0.7/glib-1.2.10/gmain.c Mon Apr 17 22:12:15 2006
48
@@ -145,6 +145,7 @@ static gboolean g_idle_dispatch (
51
#ifdef MAC_CARBON_EVENTS
52
+static void mac_run_application_event_loop (GMainLoop *loop);
53
static void mac_handle_idle_action (EventLoopTimerRef timer_ref,
54
EventLoopIdleTimerMessage state,
56
@@ -1116,7 +1117,7 @@ g_main_run (GMainLoop *loop)
57
loop->is_running = TRUE;
59
#ifdef MAC_CARBON_EVENTS
60
- RunApplicationEventLoop ();
61
+ mac_run_application_event_loop (loop);
63
while (loop->is_running)
64
g_main_iterate (TRUE, TRUE);
65
@@ -1870,4 +1871,94 @@ mac_handle_g_main_iteration_action (Even
69
-#endif /* MAC_CARBON_EVENTS */
70
\ No newline at end of file
71
+static EventHandlerUPP g_quit_event_handler_upp;
73
+static pascal OSStatus QuitEventHandler(EventHandlerCallRef inHandlerCallRef,
74
+ EventRef inEvent, void *inUserData)
78
+ if ((err = CallNextEventHandler(inHandlerCallRef, inEvent)) == noErr)
79
+ *((Boolean *)inUserData) = TRUE;
84
+static EventHandlerUPP g_event_loop_event_handler_upp;
86
+static pascal OSStatus EventLoopEventHandler(EventHandlerCallRef inHandlerCallRef,
87
+ EventRef inEvent, void *inUserData)
91
+ EventHandlerRef installedHandler;
92
+ EventTargetRef theTarget;
94
+ EventTimeout timeToWaitForEvent;
96
+ GMainLoop * loop = (GMainLoop *)inUserData;
97
+ static const EventTypeSpec eventSpec = {kEventClassApplication, kEventAppQuit};
101
+ err = InstallEventHandler(GetApplicationEventTarget(),
102
+ g_quit_event_handler_upp,
103
+ 1, &eventSpec, &quitNow, &installedHandler);
104
+ if (err == noErr) {
105
+ theTarget = GetEventDispatcherTarget();
107
+ timeToWaitForEvent = kEventDurationNoWait;
108
+ err = ReceiveNextEvent(0, NULL, timeToWaitForEvent,
110
+ if (err == noErr) {
111
+ SendEventToEventTarget(theEvent, theTarget);
112
+ ReleaseEvent(theEvent);
114
+ YieldToAnyThread();
115
+ } while ( loop->is_running && ! quitNow );
116
+ junk = RemoveEventHandler(installedHandler);
123
+mac_run_application_event_loop (GMainLoop *loop)
125
+ static const EventTypeSpec eventSpec = {'KWIN', 'KWIN' };
128
+ EventHandlerRef installedHandler;
129
+ EventRef dummyEvent;
134
+ if (g_event_loop_event_handler_upp == nil)
135
+ g_event_loop_event_handler_upp = NewEventHandlerUPP(EventLoopEventHandler);
136
+ if (g_quit_event_handler_upp == nil)
137
+ g_quit_event_handler_upp = NewEventHandlerUPP(QuitEventHandler);
138
+ if (g_event_loop_event_handler_upp == nil || g_quit_event_handler_upp == nil)
141
+ if (err == noErr) {
142
+ err = InstallEventHandler(GetApplicationEventTarget(),
143
+ g_event_loop_event_handler_upp,
144
+ 1, &eventSpec, loop, &installedHandler);
145
+ if (err == noErr) {
146
+ err = MacCreateEvent(nil, 'KWIN', 'KWIN', GetCurrentEventTime(),
147
+ kEventAttributeNone, &dummyEvent);
149
+ err = PostEventToQueue(GetMainEventQueue(), dummyEvent,
150
+ kEventPriorityHigh);
152
+ RunApplicationEventLoop();
154
+ junk = RemoveEventHandler(installedHandler);
158
+ if (dummyEvent != nil)
159
+ ReleaseEvent(dummyEvent);
161
+#endif /* MAC_CARBON_EVENTS */
162
--- gtk-osx-0.7/gtk/gtkaqua.c Sat Dec 27 23:33:36 2003
163
+++ gtk-osx-0.7/gtk/gtkaqua.c Fri May 5 07:13:30 2006
164
@@ -2183,11 +2183,12 @@ gtk_aqua_draw_focus (GtkStyle *styl
165
g_return_if_fail (window != NULL);
167
// aqua button focus is not just a simple rectangle, so we don't draw anything here
168
- if ( strcmp( detail, "button" ) == 0 ) {
170
+ if ( strcmp( detail, "button" ) == 0 )
172
- } else if ( strcmp( detail, "checkbutton" ) == 0 ) {
173
+ else if ( strcmp( detail, "checkbutton" ) == 0 )
175
- } else if ( strcmp( detail, "togglebutton" ) == 0 ) {
176
+ else if ( strcmp( detail, "togglebutton" ) == 0 )