AutoMoveWindows: try harder to get an application for a window

First of all, remove windows that are not interesting (like popup
menus and tooltips). Then, queue once an idle if the app is null,
in the hope that ShellWindowTracker picks up the window.
This commit is contained in:
Giovanni Campagna
2011-02-19 20:33:51 +01:00
parent e12ff1b6f9
commit 53384f9eaf
+15 -1
View File
@@ -32,10 +32,24 @@ WindowMover.prototype = {
}
},
_findAndMove: function(display, window) {
_findAndMove: function(display, window, noRecurse) {
if (!this._windowTracker.is_window_interesting(window))
return;
let spaces = this._settings.get_strv(SETTINGS_KEY);
let app = this._windowTracker.get_window_app(window);
if (!app) {
if (!noRecurse) {
// window is not tracked yet
Mainloop.idle_add(Lang.bind(this, function() {
this._findAndMove(display, window, true);
return false;
}));
} else
log ('Cannot find application for window');
return;
}
let app_id = app.get_id();
for ( let j = 0 ; j < spaces.length; j++ ) {
let apps_to_space = spaces[j].split(":");