macos: run glib idle functions when in nested run loop
authorArjan Molenaar <gaphor@gmail.com>
Wed, 11 Jan 2023 15:29:24 +0000 (16:29 +0100)
committerArjan Molenaar <gaphor@gmail.com>
Fri, 13 Jan 2023 19:03:55 +0000 (20:03 +0100)
It looks like DnD starts a nested run loop. We still have to run our
GLib handlers, so animations work.

gdk/macos/gdkmacoseventsource.c

index a60fb558c934f198f31f76df48082ff69b8ee7c7..725cc57476087b416e7540edb3489c1f6c8a23da 100644 (file)
@@ -1018,7 +1018,10 @@ run_loop_observer_callback (CFRunLoopObserverRef observer,
       break;
     }
 
-  if (getting_events > 0) /* Activity we triggered */
+  /* DnD starts a nested runloop, or so it seems.
+     If we have such a loop, we still want to run
+     our idle handlers. */
+  if (getting_events > 0 && current_loop_level < 2)
     return;
 
   switch (activity)