[gnome-shell] [Overview] Allow selecting windows in lightbox mode



commit 4deef2a9efad09deac99ab733929790609139c54
Author: Florian Müllner <fmuellner src gnome org>
Date:   Sun Jan 17 14:48:29 2010 +0100

    [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

 js/ui/appDisplay.js |    3 +++
 js/ui/lightbox.js   |    9 +++++----
 js/ui/runDialog.js  |    2 +-
 js/ui/workspaces.js |    4 ++--
 4 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 26e43c1..4749228 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -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;
         }
     },
 
diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js
index b3379fa..ffb583b 100644
--- a/js/ui/lightbox.js
+++ b/js/ui/lightbox.js
@@ -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();
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index 6465a6e..de8d081 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -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,
diff --git a/js/ui/workspaces.js b/js/ui/workspaces.js
index e05c195..427d313 100644
--- a/js/ui/workspaces.js
+++ b/js/ui/workspaces.js
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]