2008-10-31 14:09:20 -04:00
|
|
|
/* -*- mode: js2; js2-basic-offset: 4; -*- */
|
|
|
|
|
2008-10-31 00:22:44 -04:00
|
|
|
const Shell = imports.gi.Shell;
|
|
|
|
const Clutter = imports.gi.Clutter;
|
|
|
|
|
2008-10-31 14:09:20 -04:00
|
|
|
const Panel = imports.ui.panel;
|
2008-10-31 19:09:46 -04:00
|
|
|
const Overlay = imports.ui.overlay;
|
2008-10-31 14:09:20 -04:00
|
|
|
|
2008-10-31 14:29:42 -04:00
|
|
|
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color();
|
|
|
|
DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
|
|
|
|
|
2008-10-31 14:09:20 -04:00
|
|
|
let panel = null;
|
2008-10-31 19:09:46 -04:00
|
|
|
let overlay = null;
|
2008-10-31 14:09:20 -04:00
|
|
|
|
2008-10-31 00:22:44 -04:00
|
|
|
function start() {
|
2008-10-31 14:29:42 -04:00
|
|
|
let global = Shell.global_get();
|
|
|
|
|
|
|
|
// The background color really only matters if there is no desktop
|
|
|
|
// window (say, nautilus) running. We set it mostly so things look good
|
|
|
|
// when we are running inside Xephyr.
|
|
|
|
global.stage.color = DEFAULT_BACKGROUND_COLOR;
|
|
|
|
|
|
|
|
// Mutter currently hardcodes putting "Yessir. The compositor is running""
|
|
|
|
// in the overlay. Clear that out.
|
2008-10-31 19:09:46 -04:00
|
|
|
let children = global.overlay_group.get_children();
|
2008-10-31 14:29:42 -04:00
|
|
|
for (let i = 0; i < children.length; i++)
|
|
|
|
children[i].destroy();
|
|
|
|
|
2008-11-07 13:42:23 -05:00
|
|
|
global.connect('panel-run-dialog', function (panel) {
|
|
|
|
log("showing main menu!");
|
|
|
|
var p = new Shell.Process({'args' : ['gnome-terminal', 'gnome-terminal']})
|
|
|
|
p.run()
|
|
|
|
});
|
|
|
|
|
2008-10-31 14:09:20 -04:00
|
|
|
panel = new Panel.Panel();
|
2008-10-31 19:09:46 -04:00
|
|
|
overlay = new Overlay.Overlay();
|
|
|
|
global.set_stage_input_area(0, 0, global.screen_width, Panel.PANEL_HEIGHT);
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_overlay() {
|
|
|
|
let global = Shell.global_get();
|
|
|
|
|
|
|
|
overlay.show();
|
|
|
|
global.set_stage_input_area(0, 0, global.screen_width, global.screen_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide_overlay() {
|
|
|
|
let global = Shell.global_get();
|
|
|
|
|
|
|
|
overlay.hide();
|
|
|
|
global.set_stage_input_area(0, 0, global.screen_width, Panel.PANEL_HEIGHT);
|
2008-10-31 00:22:44 -04:00
|
|
|
}
|