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 585500 - Increase priority of region-updating idle
Increase priority of region-updating idle
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 568874
Blocks:
 
 
Reported: 2009-06-11 22:38 UTC by Owen Taylor
Modified: 2014-03-14 12:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Increase priority of region-updating idle (1.06 KB, patch)
2009-06-11 22:39 UTC, Owen Taylor
none Details | Review
layout: really queue region update before redraw (2.00 KB, patch)
2014-03-13 20:51 UTC, Daniel Drake
committed Details | Review

Description Owen Taylor 2009-06-11 22:38:42 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.
Comment 1 Owen Taylor 2009-06-11 22:39:11 UTC
Created attachment 136373 [details] [review]
Increase priority of region-updating idle
Comment 2 Owen Taylor 2009-06-11 22:40:00 UTC
Depends on the Mutter bug 568874 that adds MUTTER_PRIORITY_BEFORE_REDRAW
Comment 3 Owen Taylor 2009-06-30 13:59:24 UTC
Pushed
Comment 4 Daniel Drake 2014-03-13 20:50:04 UTC
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.
Comment 5 Daniel Drake 2014-03-13 20:51:00 UTC
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.
Comment 6 Daniel Drake 2014-03-13 20:52:04 UTC
To clarify, commit b5e467d89aea43a8e32a1138d232c8a32e6b0785 is a gjs commit.
Comment 7 Owen Taylor 2014-03-13 22:09:24 UTC
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.
Comment 8 Daniel Drake 2014-03-14 12:25:26 UTC
Thanks for the review. Filed https://bugzilla.gnome.org/show_bug.cgi?id=726333