Bug 588343 - Major rework of window monitoring to be application-based
The previous application monitoring code was originally designed to be based on WM_CLASS, which was then resolved on a server. We have that resolution code locally now, so instead of saving WM_CLASS data, save application IDs. Also, inside the WM we have a much better infrastructure for tracking windows. In particular, rather than polling, we can just watch for focus notification on the display, and window add/remove. Instead of polling XScreensaver, use DBus to watch org.gnome.Session which already has an idle time watch. Now there is no polling at all inside the monitor.
This commit is contained in:
@ -277,7 +277,8 @@ AppDisplay.prototype = {
|
||||
},
|
||||
|
||||
_getMostUsed: function() {
|
||||
return this._appMonitor.get_most_used_apps(0, 30).map(Lang.bind(this, function (id) {
|
||||
let context = "";
|
||||
return this._appMonitor.get_most_used_apps(context, 30).map(Lang.bind(this, function (id) {
|
||||
return this._appSystem.lookup_app(id + '.desktop');
|
||||
})).filter(function (e) { return e != null });
|
||||
},
|
||||
@ -723,6 +724,9 @@ AppWell.prototype = {
|
||||
},
|
||||
|
||||
_redisplay: function() {
|
||||
/* hardcode here pending some design about how exactly activities behave */
|
||||
let contextId = "";
|
||||
|
||||
let arrayToObject = function(a) {
|
||||
let o = {};
|
||||
for (let i = 0; i < a.length; i++)
|
||||
@ -731,7 +735,8 @@ AppWell.prototype = {
|
||||
};
|
||||
let favoriteIds = this._appSystem.get_favorites();
|
||||
let favoriteIdsObject = arrayToObject(favoriteIds);
|
||||
let runningIds = this._appMonitor.get_running_app_ids().filter(function (e) {
|
||||
|
||||
let runningIds = this._appMonitor.get_running_app_ids(contextId).filter(function (e) {
|
||||
return !(e in favoriteIdsObject);
|
||||
});
|
||||
let favorites = this._lookupApps(favoriteIds);
|
||||
|
Reference in New Issue
Block a user