[gnome-shell] overview: Don't show workspaces when entering the overview
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] overview: Don't show workspaces when entering the overview
- Date: Fri, 16 Mar 2012 16:21:49 +0000 (UTC)
commit 4f87e8660304405cabe987e5949e54096b8009d5
Author: Joost Verdoorn <jpverdoorn gmail com>
Date: Tue Mar 13 01:58:34 2012 +0100
overview: Don't show workspaces when entering the overview
If the user has their mouse over the workspace thumbnails while
entering the overview, it's more likely that it's a coincidence
that their mouse pointer is in the area. Avoid expanding the
thumbnails box in that case.
https://bugzilla.gnome.org/show_bug.cgi?id=651092
js/ui/workspacesView.js | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index eed675e..272aa47 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -509,6 +509,7 @@ const WorkspacesDisplay = new Lang.Class({
this._inDrag = false;
this._cancelledDrag = false;
+ this._controlsInitiallyHovered = false;
this._alwaysZoomOut = false;
this._zoomOut = false;
this._zoomFraction = 0;
@@ -543,6 +544,19 @@ const WorkspacesDisplay = new Lang.Class({
},
show: function() {
+ if(!this._alwaysZoomOut) {
+ let [mouseX, mouseY] = global.get_pointer();
+ let [x, y] = this._controls.get_transformed_position();
+ let [width, height] = this._controls.get_transformed_size();
+ let visibleWidth = this._controls.get_theme_node().get_length('visible-width');
+ let rtl = (Clutter.get_default_text_direction () == Clutter.TextDirection.RTL);
+ if(rtl)
+ x = x + width - visibleWidth;
+ if(mouseX > x - 0.5 && mouseX < x + visibleWidth + 0.5 &&
+ mouseY > y - 0.5 && mouseY < y + height + 0.5)
+ this._controlsInitiallyHovered = true;
+ }
+
this._zoomOut = this._alwaysZoomOut;
this._zoomFraction = this._alwaysZoomOut ? 1 : 0;
this._updateZoom();
@@ -591,6 +605,9 @@ const WorkspacesDisplay = new Lang.Class({
this._controls.hide();
this._thumbnailsBox.hide();
+ if (!this._alwaysZoomOut)
+ this.zoomFraction = 0;
+
if (this._restackedNotifyId > 0){
global.screen.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0;
@@ -996,7 +1013,10 @@ const WorkspacesDisplay = new Lang.Class({
},
_onControlsHoverChanged: function() {
- this._updateZoom();
+ if(!this._controls.hover)
+ this._controlsInitiallyHovered = false;
+ if(!this._controlsInitiallyHovered)
+ this._updateZoom();
},
_dragBegin: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]