From 29485ff24b60a7ec1a95f311642994d11cae7227 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Thu, 13 Mar 2014 14:46:34 -0600 Subject: [PATCH] layout: really queue region update before redraw This code may have worked when written in 2009, but later gjs 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, which is actually slightly better in this case anyway. Solves the unresponsiveness problem. https://bugzilla.gnome.org/show_bug.cgi?id=585500 --- js/ui/layout.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/ui/layout.js b/js/ui/layout.js index 82d848a5a..7b3647cb7 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -4,7 +4,6 @@ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const Lang = imports.lang; -const Mainloop = imports.mainloop; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const Signals = imports.signals; @@ -907,8 +906,8 @@ const LayoutManager = new Lang.Class({ return; if (!this._updateRegionIdle) - this._updateRegionIdle = Mainloop.idle_add(Lang.bind(this, this._updateRegions), - Meta.PRIORITY_BEFORE_REDRAW); + this._updateRegionIdle = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, + Lang.bind(this, this._updateRegions)); }, _getWindowActorsForWorkspace: function(workspace) { @@ -939,7 +938,7 @@ const LayoutManager = new Lang.Class({ let rects = [], struts = [], i; if (this._updateRegionIdle) { - Mainloop.source_remove(this._updateRegionIdle); + Meta.later_remove(this._updateRegionIdle); delete this._updateRegionIdle; }