Fix 'mono' package typo
[mono.git] / bockbuild / mac-sdk / patches / gtk / bxc_10256_window_tools_get_confused.diff
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
5  from Cocoa
6
7 ---
8  gdk/quartz/gdkeventloop-quartz.c |   20 ++++++++++++++++++++
9  1 files changed, 20 insertions(+), 0 deletions(-)
10
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   ************************************************************/
18
19 +static inline void
20 +ensure_finish_launching_called (void)
21 +{
22 +  static volatile gsize finish_launched_called = 0;
23 +
24 +  if (g_once_init_enter (&finish_launched_called))
25 +    {
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.
29 +       */
30 +      [NSApp finishLaunching];
31 +
32 +      g_once_init_leave (&finish_launched_called, TRUE);
33 +    }
34 +}
35 +
36  static gint
37  poll_func (GPollFD *ufds,
38            guint    nfds,
39 @@ -706,6 +723,9 @@ poll_func (GPollFD *ufds,
40    static GPollFD *current_ufds = NULL;
41    static int current_nfds = 0;
42
43 +  /* This is performed *once* before we poll Cocoa for the first event. */
44 +  ensure_finish_launching_called ();
45 +
46    current_ufds = ufds;
47    current_nfds = nfds;
48
49 --
50 1.7.4.4