[Overview] Allow selecting windows in lightbox mode

Make the event blocking done by Lightbox optional - leave it activated
when displaying the run dialog, but deactivate it when highlighting
windows in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=602774
This commit is contained in:
Florian Müllner 2010-01-17 14:48:29 +01:00
parent dd9a29633a
commit 4deef2a9ef
4 changed files with 11 additions and 7 deletions

View File

@ -433,6 +433,8 @@ AppWellIcon.prototype = {
},
highlightWindow: function(metaWindow) {
if (this._didActivateWindow)
return;
if (!this._getRunning())
return;
Main.overview.getWorkspacesForWindow(metaWindow).setHighlightWindow(metaWindow);
@ -450,6 +452,7 @@ AppWellIcon.prototype = {
if (this._getRunning()) {
Main.overview.getWorkspacesForWindow(null).setApplicationWindowSelection(this.app.get_id());
this._setWindowSelection = true;
this._didActivateWindow = false;
}
},

View File

@ -12,6 +12,7 @@ SHADE_COLOR.from_pixel(0x00000044);
/**
* Lightbox:
* @container: parent Clutter.Container
* @inhibitEvents: whether to inhibit events for @container
* @width: (optional) shade actor width
* @height: (optional) shade actor height
*
@ -29,19 +30,19 @@ SHADE_COLOR.from_pixel(0x00000044);
* @container and will track any changes in its size. You can override
* this by passing an explicit width and height
*/
function Lightbox(container, width, height) {
this._init(container, width, height);
function Lightbox(container, inhibitEvents, width, height) {
this._init(container, inhibitEvents, width, height);
}
Lightbox.prototype = {
_init : function(container, width, height) {
_init : function(container, inhibitEvents, width, height) {
this._container = container;
this._children = container.get_children();
this.actor = new Clutter.Rectangle({ color: SHADE_COLOR,
x: 0,
y: 0,
border_width: 0,
reactive: true });
reactive: inhibitEvents });
container.add_actor(this.actor);
this.actor.raise_top();

View File

@ -216,7 +216,7 @@ RunDialog.prototype = {
height: global.screen_height });
global.stage.add_actor(this._group);
let lightbox = new Lightbox.Lightbox(this._group);
let lightbox = new Lightbox.Lightbox(this._group, true);
this._boxH = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
x_align: Big.BoxAlignment.CENTER,

View File

@ -199,7 +199,7 @@ WindowClone.prototype = {
this._zooming = true;
this.emit('zoom-start');
this._zoomLightbox = new Lightbox.Lightbox(global.stage);
this._zoomLightbox = new Lightbox.Lightbox(global.stage, false);
this._zoomLocalOrig = new ScaledPoint(this.actor.x, this.actor.y, this.actor.scale_x, this.actor.scale_y);
this._zoomGlobalOrig = new ScaledPoint();
@ -672,7 +672,7 @@ Workspace.prototype = {
*/
setLightboxMode: function (showLightbox) {
if (showLightbox) {
this._lightbox = new Lightbox.Lightbox(this.actor);
this._lightbox = new Lightbox.Lightbox(this.actor, false);
} else {
this._lightbox.destroy();
this._lightbox = null;