[gnome-shell] [Overview] Fix click handling of open panes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] [Overview] Fix click handling of open panes
- Date: Sun, 7 Mar 2010 22:42:03 +0000 (UTC)
commit fe0f4060c411cbcdc288a12f8fdde2ff9f7a436c
Author: Florian Müllner <fmuellner src gnome org>
Date: Thu Mar 4 00:10:16 2010 +0100
[Overview] Fix click handling of open panes
The top part of the application pane closes the pane, while outside
the menu only the workspace area accepts clicks for closing the pane.
Let the user close the pane by clicking anywhere outside the menu, but
not inside.
https://bugzilla.gnome.org/show_bug.cgi?id=611641
js/ui/appDisplay.js | 3 ++-
js/ui/overview.js | 16 +++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index f18745f..7ae0b08 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -87,7 +87,8 @@ AllAppDisplay.prototype = {
Main.queueDeferredWork(this._workId);
}));
- let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel' });
+ let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel',
+ reactive: true });
this.actor = new St.BoxLayout({ style_class: 'all-app', vertical: true });
this.actor.hide();
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 1f2ca9b..1f0ee4b 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -372,9 +372,8 @@ Overview.prototype = {
}));
}
- this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y);
- this._transparentBackground.set_size(primary.width - this._paneContainer.x,
- this._paneContainer.height);
+ this._transparentBackground.set_position(primary.x, primary.y);
+ this._transparentBackground.set_size(primary.width, primary.height);
},
@@ -391,10 +390,17 @@ Overview.prototype = {
this._transparentBackground.raise_top();
this._paneContainer.raise_top();
this._paneContainer.show();
+ this._paneReady = false;
if (backgroundEventId != null)
this._transparentBackground.disconnect(backgroundEventId);
- backgroundEventId = this._transparentBackground.connect('button-release-event', Lang.bind(this, function () {
- this._activeDisplayPane.close();
+ backgroundEventId = this._transparentBackground.connect('captured-event', Lang.bind(this, function (actor, event) {
+ if (event.get_source() != this._transparentBackground)
+ return false;
+ if (event.type() == Clutter.EventType.BUTTON_PRESS)
+ this._paneReady = true;
+ if (event.type() == Clutter.EventType.BUTTON_RELEASE
+ && this._paneReady)
+ this._activeDisplayPane.close();
return true;
}));
this._workspaces.actor.opacity = 64;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]