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

View File

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

View File

@ -216,7 +216,7 @@ RunDialog.prototype = {
height: global.screen_height }); height: global.screen_height });
global.stage.add_actor(this._group); 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, this._boxH = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
x_align: Big.BoxAlignment.CENTER, x_align: Big.BoxAlignment.CENTER,

View File

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