add the initial framework of a window management interface. #561724
svn path=/trunk/; revision=70
This commit is contained in:
29
js/ui/windowmanager.js
Normal file
29
js/ui/windowmanager.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; -*- */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Shell = imports.gi.Shell;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
|
||||
function WindowManager(shellwm) {
|
||||
this._init(shellwm);
|
||||
}
|
||||
|
||||
WindowManager.prototype = {
|
||||
_init : function(shellwm) {
|
||||
let global = Shell.global_get();
|
||||
let shellwm = global.window_manager;
|
||||
|
||||
shellwm.connect('switch-workspace',
|
||||
function(o, from, to, direction) {
|
||||
let actors = shellwm.get_switch_workspace_actors();
|
||||
for (let i = 0; i < actors.length; i++) {
|
||||
if (actors[i].get_workspace() == from)
|
||||
actors[i].hide();
|
||||
else if (actors[i].get_workspace() == to)
|
||||
actors[i].show();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user