Comment 15 for bug 871968

Revision history for this message
David Mathog (mathog) wrote :

Moved problem from glibmm to glib, as that is where the patch to fix it must go.

https://bugzilla.gnome.org/show_bug.cgi?id=675695

Since it is a glib problem hopefully the upstream package will eventually be changed. In the meantime, whoever is maintaining devlibs could maybe put in the (tiny) changes needed to squish this CPU problem on Inkscape? Note the "fix" just disables the ability to set a timer shorter than 10ms. I could not "feel" any difference when Inkscape was run that way, but perhaps there is some tool that might be sensitive to it.

The change to glib resolves this issue through trunk 11289, which is the most recent version tested.

This is the change to the g_timeout_prepare function in glib/gmain.c that fixes the issue:

  if (now < timeout_source->expiration
#ifdef G_OS_WIN32
      && timeout_source->expiration - now > 10000) //minimum of 10msec wait
#else
      )
#endif
    {
      /* Round up to ensure that we don't try again too early */
      *timeout = (timeout_source->expiration - now + 999) / 1000;
      return FALSE;
    }