1 From c7143a37ec4d802710442380bc4cfd0d521350bd Mon Sep 17 00:00:00 2001
2 From: Kristian Rietveld <kris@lanedo.com>
3 Date: Sat, 23 Feb 2013 13:51:18 +0100
4 Subject: [PATCH] Call NSApp finishLaunching before polling the first event
8 gdk/quartz/gdkeventloop-quartz.c | 20 ++++++++++++++++++++
9 1 files changed, 20 insertions(+), 0 deletions(-)
11 diff --git a/gdk/quartz/gdkeventloop-quartz.c b/gdk/quartz/gdkeventloop-quartz.c
12 index 224d84c..80ef87f 100644
13 --- a/gdk/quartz/gdkeventloop-quartz.c
14 +++ b/gdk/quartz/gdkeventloop-quartz.c
15 @@ -695,6 +695,23 @@ static GSourceFuncs event_funcs = {
16 ********* Our Poll Function *********
17 ************************************************************/
20 +ensure_finish_launching_called (void)
22 + static volatile gsize finish_launched_called = 0;
24 + if (g_once_init_enter (&finish_launched_called))
26 + /* This call finished application start up and enables for example
27 + * accessibility support. This function is called from poll_func
28 + * and an autorelease pool is set up at that point.
30 + [NSApp finishLaunching];
32 + g_once_init_leave (&finish_launched_called, TRUE);
37 poll_func (GPollFD *ufds,
39 @@ -706,6 +723,9 @@ poll_func (GPollFD *ufds,
40 static GPollFD *current_ufds = NULL;
41 static int current_nfds = 0;
43 + /* This is performed *once* before we poll Cocoa for the first event. */
44 + ensure_finish_launching_called ();