GNOME Bugzilla – Bug 585500
Increase priority of region-updating idle
Last modified: 2014-03-14 12:25:26 UTC
Increase the priority of the idle for updating work area and struts to META_PRIORITY_BEFORE_REDRAW. This prevents it from being starved by a constantly-redrawing client.
Created attachment 136373 [details] [review] Increase priority of region-updating idle
Depends on the Mutter bug 568874 that adds MUTTER_PRIORITY_BEFORE_REDRAW
Pushed
This looks like it will have worked in 2009 but it is broken in the current code, because idle_add is defined as: function idle_add(handler) { return idle_source(handler).attach(null); } i.e. no priority argument.
Created attachment 271801 [details] [review] layout: really queue region update before redraw This code may have worked when written in 2009, but later commit b5e467d89aea43a8e32a1138d232c8a32e6b0785 removed the priority parameter from idle_add. Now, when running a constantly-updating client (es2gears) on an embedded platform, _updateRegions() does not get called and I see unresponsive window decorations. Update the code to use meta_later_add() like other parts of the shell. Solves the unresponsiveness problem.
To clarify, commit b5e467d89aea43a8e32a1138d232c8a32e6b0785 is a gjs commit.
Review of attachment 271801 [details] [review]: Looks fine, and it's better to use laters than idles - idle_add(BEFORE_REDRAW) will be before the *next* redraw if we're already processing events. However, can you file a bug against gjs to add the the optional priority arguments back to the compat wrappers? I think they were unintentionally lost and are useful for other things.
Thanks for the review. Filed https://bugzilla.gnome.org/show_bug.cgi?id=726333