add the initial framework of a window management interface. #561724

svn path=/trunk/; revision=70
This commit is contained in:
Dan Winship
2008-11-21 14:02:09 +00:00
parent 06bde9cc98
commit 7dba934b96
9 changed files with 335 additions and 6 deletions

View File

@ -6,6 +6,7 @@ const Clutter = imports.gi.Clutter;
const Panel = imports.ui.panel;
const Overlay = imports.ui.overlay;
const RunDialog = imports.ui.run_dialog;
const WindowManager = imports.ui.windowmanager;
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color();
DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
@ -13,6 +14,7 @@ DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
let panel = null;
let overlay = null;
let run_dialog = null;
let wm = null;
function start() {
let global = Shell.global_get();
@ -43,8 +45,10 @@ function start() {
});
panel = new Panel.Panel();
overlay = new Overlay.Overlay();
global.set_stage_input_area(0, 0, global.screen_width, Panel.PANEL_HEIGHT);
overlay = new Overlay.Overlay();
wm = new WindowManager.WindowManager();
}
function show_overlay() {

29
js/ui/windowmanager.js Normal file
View 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();
}
});
}
};