[gtk-mac-integration] [Bug 698334] Mac top-of-screen menu not working properly



commit 0632a245cb5b8fe70879626227ed230f399d112a
Author: John Ralls <jralls ceridwen us>
Date:   Tue Jun 25 15:48:33 2013 -0700

    [Bug 698334] Mac top-of-screen menu not working properly
    
    Fix the delay by putting a bogus event to wake up the mainloop.

 src/GNSMenuItem.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/GNSMenuItem.c b/src/GNSMenuItem.c
index 72d0aeb..c177359 100644
--- a/src/GNSMenuItem.c
+++ b/src/GNSMenuItem.c
@@ -59,8 +59,12 @@ idle_call_activate (ClosureData *action)
 
 - (void) activate:(id) sender
 {
-/* Add an idle in a thread-safe way: */
-    gdk_threads_add_idle ((GSourceFunc)idle_call_activate, &action);
+/* Add an idle in a thread-safe way and wake up the main loop with
+   a bogus event: */
+  GdkEvent *wake_up = gdk_event_new (GDK_NOTHING);
+  gdk_threads_add_idle ((GSourceFunc)idle_call_activate, &action);
+  gdk_event_put (wake_up);
+  gdk_event_free (wake_up);
 }
 
 - (BOOL) isHidden


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]