After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550989 - gdk_display_put_event() should call g_main_context_wakeup()
gdk_display_put_event() should call g_main_context_wakeup()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-09-05 13:30 UTC by Owen Taylor
Modified: 2008-09-07 00:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2008-09-05 13:30:33 UTC
If GDK threading is initialized and you call gdk_display_put_event() from another thread, it won't wake up the main loop in the main thread to deliver the event.

Pseudo-patch:

void
gdk_display_put_event (GdkDisplay     *display,
                       const GdkEvent *event)
{
  g_return_if_fail (GDK_IS_DISPLAY (display));
  g_return_if_fail (event != NULL);

  _gdk_event_queue_append (display, gdk_event_copy (event));
+  /* If the main loop is blocking in a different thread, wake it up */
+  g_main_context_wakeup (NULL); 
}
Comment 1 Matthias Clasen 2008-09-07 00:43:26 UTC
2008-09-06  Matthias Clasen  <mclasen@redhat.com>

        Bug 550989 – gdk_display_put_event() should call
        g_main_context_wakeup()

        * gdk/gdkdisplay.c (gdk_display_put_event): Wake up the main loop
        after queueing the event. Patch by Owen Taylor