gnome-shell/js/ui/main.js
Owen Taylor 9e45cf84fb First cut at activities overlay
When the user clicks on "Activities", adjust the input shape
to the whole screen and show a black overlay group. Actually, the
black should be *beneath* the window actors and the overlay group
transparent so we can fade in the black while leaving the windows
unfaded, visible, but shrunk and rearranged.

svn path=/trunk/; revision=14
2008-10-31 23:09:46 +00:00

47 lines
1.3 KiB
JavaScript

/* -*- mode: js2; js2-basic-offset: 4; -*- */
const Shell = imports.gi.Shell;
const Clutter = imports.gi.Clutter;
const Panel = imports.ui.panel;
const Overlay = imports.ui.overlay;
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color();
DEFAULT_BACKGROUND_COLOR.from_pixel(0x2266bbff);
let panel = null;
let overlay = null;
function start() {
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.
let children = global.overlay_group.get_children();
for (let i = 0; i < children.length; i++)
children[i].destroy();
panel = new Panel.Panel();
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);
}