After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682050 - Hide overview elements while searching
Hide overview elements while searching
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 681797 682286 690175
Blocks:
 
 
Reported: 2012-08-16 22:40 UTC by Tanner Doshier
Modified: 2013-02-14 23:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overview and others: Rename item-drag signals to app-drag (10.59 KB, patch)
2012-08-16 22:43 UTC, Tanner Doshier
accepted-commit_now Details | Review
dash: Add show() and hide() methods (3.31 KB, patch)
2012-08-16 22:44 UTC, Tanner Doshier
reviewed Details | Review
workspaceThumbnail: Fix typo, removeThumbmails --> removeThumbnails (903 bytes, patch)
2012-08-16 22:44 UTC, Tanner Doshier
needs-work Details | Review
workspaceThumbnail: Make ThumbnailsBox track workspace changes itself (2.56 KB, patch)
2012-08-16 22:44 UTC, Tanner Doshier
reviewed Details | Review
workspaceThumbnail: React to scroll event (1.52 KB, patch)
2012-08-16 22:45 UTC, Tanner Doshier
reviewed Details | Review
workspaceThumbnail: Rename show(), hide() and add new methods (4.11 KB, patch)
2012-08-16 22:45 UTC, Tanner Doshier
needs-work Details | Review
workspaceThumbnail: Add keyboard nav to ThumbnailsBox (2.21 KB, patch)
2012-08-16 22:45 UTC, Tanner Doshier
accepted-commit_now Details | Review
overview: Make dash a public property (2.61 KB, patch)
2012-08-16 22:45 UTC, Tanner Doshier
accepted-commit_now Details | Review
overview: Use ThumbnailsBox for standalone workspace thumbnails (3.10 KB, patch)
2012-08-16 22:45 UTC, Tanner Doshier
needs-work Details | Review
workspacesView: Remove handling of 'controls' since ThumbnailsBox is independent (12.03 KB, patch)
2012-08-16 22:46 UTC, Tanner Doshier
reviewed Details | Review
viewSelector: Return a new constraint to those that ask (2.64 KB, patch)
2012-08-16 22:46 UTC, Tanner Doshier
accepted-commit_now Details | Review
viewSelector: Add search-begin signal and connect search signals to hide/show (1.56 KB, patch)
2012-08-16 22:46 UTC, Tanner Doshier
needs-work Details | Review
viewSelector: Connect app-drag signals to show/hide overview elements (2.04 KB, patch)
2012-08-16 22:46 UTC, Tanner Doshier
needs-work Details | Review
messageTray, viewSelector: show/hide message tray on search signals (4.68 KB, patch)
2012-08-16 23:34 UTC, Tanner Doshier
reviewed Details | Review
overview and others: Rename item-drag signals to app-drag (10.59 KB, patch)
2012-08-28 17:22 UTC, Tanner Doshier
none Details | Review
dash: Add show/hide methods (2.80 KB, patch)
2012-08-28 17:23 UTC, Tanner Doshier
none Details | Review
dash: fix for shrinking dash while animating (1.26 KB, patch)
2012-08-28 17:25 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: Fix typo, removeThumbmails --> removeThumbnails (1.39 KB, patch)
2012-08-28 17:26 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: Make ThumbnailsBox track workspace changes itself (3.45 KB, patch)
2012-08-28 17:27 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: React to scroll event (2.77 KB, patch)
2012-08-28 17:28 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: Rename show(), hide() and add new methods (4.16 KB, patch)
2012-08-28 17:29 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: Add keyboard nav to ThumbnailsBox (2.20 KB, patch)
2012-08-28 17:33 UTC, Tanner Doshier
none Details | Review
overview, workspacesView: Use ThumbnailsBox for independent workspace thumbnails (16.74 KB, patch)
2012-08-28 17:40 UTC, Tanner Doshier
none Details | Review
viewSelector: Return a new constraint to those that ask (2.27 KB, patch)
2012-08-28 17:42 UTC, Tanner Doshier
none Details | Review
viewSelector, overview: Add search signals and connect them to hide/show (2.04 KB, patch)
2012-08-28 17:44 UTC, Tanner Doshier
none Details | Review
overview: Connect app-drag signals to show/hide overview elements (2.72 KB, patch)
2012-08-28 17:45 UTC, Tanner Doshier
none Details | Review
messageTray, viewSelector: show/hide message tray on search signals (3.06 KB, patch)
2012-08-28 17:51 UTC, Tanner Doshier
none Details | Review
viewSelector: this.active --> this.entryNonEmpty (3.62 KB, patch)
2012-08-28 17:58 UTC, Tanner Doshier
none Details | Review
viewSelector: remove switching from search results on app-drag-begin (895 bytes, patch)
2012-08-28 18:06 UTC, Tanner Doshier
none Details | Review
workspaceThumbnail: pack ThumbnailsBox in the overview directly (30.12 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
reviewed Details | Review
workspaceThumbnail: add methods to show/hide (2.44 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
viewSelector: notify on active page changes (1.87 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
overview: set side controls visibility on view page change (2.31 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
workspace: include the close button overlap in the right side chrome (919 bytes, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
workspacesView: simplify code (3.28 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
dash: add methods to show/hide (5.33 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
needs-work Details | Review
overview: hide side controls when searching (1.57 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
needs-work Details | Review
dash: slide in on drag-begin (1.52 KB, patch)
2013-02-13 17:49 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
workspaceThumbnails: don't slide in for drag if hidden (996 bytes, patch)
2013-02-13 17:50 UTC, Cosimo Cecchi
reviewed Details | Review
viewSelector: don't change page on drag begin (931 bytes, patch)
2013-02-13 17:50 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
viewSelector: add a method to get the currently active page (1.34 KB, patch)
2013-02-13 23:01 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
overview: set side controls visibility on view page change (1.79 KB, patch)
2013-02-13 23:01 UTC, Cosimo Cecchi
reviewed Details | Review
overview: hide side controls when searching (1.17 KB, patch)
2013-02-13 23:02 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
dash: add methods to show/hide (6.06 KB, patch)
2013-02-13 23:04 UTC, Cosimo Cecchi
reviewed Details | Review
workspaceThumbnail: add methods to show/hide (2.07 KB, patch)
2013-02-13 23:08 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
workspaceThumbnail: pack ThumbnailsBox in the overview directly (30.74 KB, patch)
2013-02-14 04:07 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
Introduce a SlideLayout layout manager (3.35 KB, patch)
2013-02-14 21:11 UTC, Cosimo Cecchi
reviewed Details | Review
workspaceThumbnail: pack ThumbnailsBox in the overview directly (30.50 KB, patch)
2013-02-14 21:12 UTC, Cosimo Cecchi
accepted-commit_now Details | Review
overview: set side controls visibility on view page change (1.79 KB, patch)
2013-02-14 21:12 UTC, Cosimo Cecchi
none Details | Review
dash: add methods to show/hide (5.02 KB, patch)
2013-02-14 21:13 UTC, Cosimo Cecchi
reviewed Details | Review
Introduce a SlideLayout layout manager (5.51 KB, patch)
2013-02-14 22:53 UTC, Cosimo Cecchi
committed Details | Review
workspaceThumbnail: pack ThumbnailsBox in the overview directly (21.78 KB, patch)
2013-02-14 22:53 UTC, Cosimo Cecchi
committed Details | Review
viewSelector: notify on active page changes (1.87 KB, patch)
2013-02-14 22:53 UTC, Cosimo Cecchi
committed Details | Review
viewSelector: add a method to get the currently active page (1.34 KB, patch)
2013-02-14 22:53 UTC, Cosimo Cecchi
committed Details | Review
overview: set side controls visibility on view page change (1.80 KB, patch)
2013-02-14 22:53 UTC, Cosimo Cecchi
committed Details | Review
workspace: include the close button overlap in the right side chrome (919 bytes, patch)
2013-02-14 22:54 UTC, Cosimo Cecchi
committed Details | Review
workspacesView: simplify code (3.28 KB, patch)
2013-02-14 22:54 UTC, Cosimo Cecchi
committed Details | Review
dash: add a SlidingControl for the dash actor (2.80 KB, patch)
2013-02-14 22:54 UTC, Cosimo Cecchi
committed Details | Review
overview: hide side controls when searching (1.12 KB, patch)
2013-02-14 22:54 UTC, Cosimo Cecchi
committed Details | Review
viewSelector: don't change page on drag begin (931 bytes, patch)
2013-02-14 22:54 UTC, Cosimo Cecchi
committed Details | Review

Description Tanner Doshier 2012-08-16 22:40:40 UTC
Overview elements being the dash, message tray and workspace switcher. They should slide out of view at the start of a search and slide back in if it is cancelled. If the user drags an app launcher, slide the dash and workspace switcher back into view for them to interact with.

See https://live.gnome.org/GnomeShell/Design/Whiteboards/Search

The following work depends on Bug 681797.
Comment 1 Tanner Doshier 2012-08-16 22:43:03 UTC
Created attachment 221510 [details] [review]
overview and others: Rename item-drag signals to app-drag

Since results other than apps should not be draggable, be more descriptive and
rename item-drag signals to app-drag signals.
Comment 2 Tanner Doshier 2012-08-16 22:44:09 UTC
Created attachment 221511 [details] [review]
dash: Add show() and hide() methods

The this.actor.height > this._maxHeight check is needed because animating the
dash out causes constant notify::height signals and so after each one the max
height would shrink to the actor height causing the icons to shrink until
eventually we get to 16px icons. This way, only increase maxHeight if the
actor can be drawn bigger than it is currently set.
Comment 3 Tanner Doshier 2012-08-16 22:44:18 UTC
Created attachment 221512 [details] [review]
workspaceThumbnail: Fix typo, removeThumbmails --> removeThumbnails
Comment 4 Tanner Doshier 2012-08-16 22:44:56 UTC
Created attachment 221513 [details] [review]
workspaceThumbnail: Make ThumbnailsBox track workspace changes itself
Comment 5 Tanner Doshier 2012-08-16 22:45:08 UTC
Created attachment 221514 [details] [review]
workspaceThumbnail: React to scroll event
Comment 6 Tanner Doshier 2012-08-16 22:45:24 UTC
Created attachment 221515 [details] [review]
workspaceThumbnail: Rename show(), hide() and add new methods

show() and hide() now slide the thumbnails in and out, respectively. The old
show and hide are now _createThumbnails and _destroyThumbnails. We only care
about these thumbnails while in the overview, so create them when entering and
destroy them on exit.
Comment 7 Tanner Doshier 2012-08-16 22:45:38 UTC
Created attachment 221516 [details] [review]
workspaceThumbnail: Add keyboard nav to ThumbnailsBox
Comment 8 Tanner Doshier 2012-08-16 22:45:46 UTC
Created attachment 221517 [details] [review]
overview: Make dash a public property
Comment 9 Tanner Doshier 2012-08-16 22:45:52 UTC
Created attachment 221518 [details] [review]
overview: Use ThumbnailsBox for standalone workspace thumbnails
Comment 10 Tanner Doshier 2012-08-16 22:46:08 UTC
Created attachment 221519 [details] [review]
workspacesView: Remove handling of 'controls' since ThumbnailsBox is independent

This breaks currently functionality of hiding most of the workspace thumbnails
when they aren't being used (< 2 workspaces). The workspace thumbnails are
always present, or when hidden, their allocation still exists, i.e., the
viewSelector does not resize when the thumbnails do. This works similar to the
Dash.
Comment 11 Tanner Doshier 2012-08-16 22:46:15 UTC
Created attachment 221520 [details] [review]
viewSelector: Return a new constraint to those that ask

Every actor requesting a constraint needs a new one, they can't all share the
same one.
Comment 12 Tanner Doshier 2012-08-16 22:46:24 UTC
Created attachment 221521 [details] [review]
viewSelector: Add search-begin signal and connect search signals to hide/show

Hide the elements when the search entry is non-empty. Show them if the search
is cancelled.
Comment 13 Tanner Doshier 2012-08-16 22:46:37 UTC
Created attachment 221522 [details] [review]
viewSelector: Connect app-drag signals to show/hide overview elements

Anytime we begin dragging an app launcher, ensure the overview elements are
showing. While searching, if an app-drag ends or is cancelled, hide the
overview elements, but don't switch back to windows (which was the old
behavior).
Comment 14 Tanner Doshier 2012-08-16 23:34:43 UTC
Created attachment 221526 [details] [review]
messageTray, viewSelector: show/hide message tray on search signals

--

Separate commit for now, since message tray is still in flux.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-08-16 23:52:25 UTC
Review of attachment 221510 [details] [review]:

Hm. I'm not sure how I feel about this. What if you want to launch a search result on another workspace?

Code looks fine, though.
Comment 16 Jasper St. Pierre (not reading bugmail) 2012-08-16 23:55:06 UTC
Review of attachment 221511 [details] [review]:

Wait, why does animating the x position cause notify::height signals?

::: js/ui/dash.js
@@ +305,3 @@
+        this.visible = false;
+        this._hiddenX;
+        this._targetX;

uhhhh

@@ +326,3 @@
                     this._queueRedisplay();
+                if (this.actor.height > this._maxHeight)
+                    this._maxHeight = this.actor.height;

Separate patch.

@@ +503,3 @@
     },
 
+    _updateDashX: function() {

This is a bit badly named. _calculateDashX or _computeDashX seems better to me.

@@ +506,3 @@
+        this._targetX = this.actor.get_x();
+
+        let rtl = (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL);

Use this.actor.get_text_direction()

@@ +897,3 @@
+        this.actor.show();
+        Tweener.addTween(this.actor,
+            return;

Indentation seems a bit strange here.

@@ +915,3 @@
+                         onComplete: Lang.bind(this, function () {
+                                           this.actor.hide();
+                       });

Whitespace here needs to be fixed.
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-08-16 23:56:48 UTC
Review of attachment 221512 [details] [review]:

Hah. Who made that one?

You need to fix the call in workspacesView.js, though.
Comment 18 Jasper St. Pierre (not reading bugmail) 2012-08-16 23:57:30 UTC
Review of attachment 221513 [details] [review]:

Are you going to remove the old code that triggered this, or?
Comment 19 Jasper St. Pierre (not reading bugmail) 2012-08-16 23:59:40 UTC
Review of attachment 221514 [details] [review]:

Again, there's code somewhere that deals with scroll events on the workspace thumbnails. Are you going to replace it?

::: js/ui/workspaceThumbnail.js
@@ +1181,3 @@
+
+    _onScrollEvent: function (actor, event) {
+        switch ( event.get_scroll_direction() ) {

Whitespace is bad.
Comment 20 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:00:25 UTC
Review of attachment 221515 [details] [review]:

Same comments for the dash as there are for this code.
Comment 21 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:01:21 UTC
Review of attachment 221516 [details] [review]:

::: js/ui/workspaceThumbnail.js
@@ +1247,3 @@
+
+    _onKeyRelease: function (actor, event) {
+        switch ( event.get_key_symbol() ) {

Whitespace.

@@ +1255,3 @@
+            break;
+        case Clutter.KEY_Return:
+            Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);

I'm not so sure about this. I think about in terms of highlighting a workspace, and hitting enter to "select" it.

But this is fine too if it works out in practice.
Comment 22 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:01:43 UTC
Review of attachment 221517 [details] [review]:

Sure.
Comment 23 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:05:18 UTC
Review of attachment 221518 [details] [review]:

Oh.

Oh.

You have no idea how happy I am that you are doing this. You are awesome.

Again, you need to remove the old code in the view selector I think. I'm also not sure how you're going to handle the zoom fraction stuff where the workspace switcher comes out and takes over part of the view selector. I'd really like it if you went in the direction I suggested, but it might be a bit fancy.

::: js/ui/overview.js
@@ +33,2 @@
 const DASH_SPLIT_FRACTION = 0.1;
+const WORKSPACE_THUMBNAILS_SPLIT_FRACTION = 0.15;

I'd like to see these "fractions" (read: lies) replaced at some point.

Preferably, I'd like to see the overview become a horizontal StBoxLayout or a custom LayoutManager or something, split between the dash, the view selector, and the workspace thumbnails.

Also, you're not joost! Why are you working on this!

@@ +516,3 @@
         let viewHeight = contentHeight - 2 * this._spacing;
         let viewY = contentY + this._spacing;
+        let viewX = rtl ? thumbnailsBoxWidth + this._spacing : dashWidth + this._spacing;

Yeah, I'm not so certain this is going in the right direction, but it works for now I guess.
Comment 24 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:06:02 UTC
Review of attachment 221519 [details] [review]:

Parts of this code should be squashed with previous patches.
Comment 25 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:06:42 UTC
Review of attachment 221520 [details] [review]:

Sure.

It's disappointing that Constraints are tied to an actor, but sure.
Comment 26 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:07:58 UTC
Review of attachment 221521 [details] [review]:

I'd really like it if the overview itself connected to the signals the view selector spat out, and kept track of its own state.

Otherwise, we might have components fighting over the overview's own actors.
Comment 27 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:08:33 UTC
Review of attachment 221522 [details] [review]:

Ditto for last patch.
Comment 28 Jasper St. Pierre (not reading bugmail) 2012-08-17 00:09:03 UTC
Review of attachment 221526 [details] [review]:

Why?
Comment 29 Jasper St. Pierre (not reading bugmail) 2012-08-20 01:35:33 UTC
If you can attach your incomplete patches here (or push them to a branch somewhere), I can probably clean them up and finish them for 3.6. It would also help with overview relayout.
Comment 30 Florian Müllner 2012-08-24 13:09:05 UTC
Comment on attachment 221517 [details] [review]
overview: Make dash a public property

This is clearly not wrong, however I think a nicer approach is to expose Main.overview.(show|hide)Sidebars() methods and call that from the viewSelector as approriate. That way both dash and workspaceSwitcher can remain private to the overview, and the viewSelector doesn't need to expose any signals, but just call the appropriate method when switching pages.
(I know that this patch series predates the mode-switch-kill)
Comment 31 Florian Müllner 2012-08-24 14:20:51 UTC
(In reply to comment #23)
> Preferably, I'd like to see the overview become a horizontal StBoxLayout or a
> custom LayoutManager or something, split between the dash, the view selector,
> and the workspace thumbnails.

I don't think this is an option - looking at the mockups[0], the viewSelector needs to extend to the right monitor edge (below the workspace switcher, if it is visible). For symmetry reasons (and in preparation for a nicer apps-view animation), it probably makes sense to do the same for the dash.

We could still use a vertical BoxLayout that covers the entire area between top bar and message-tray and holds search entry and viewSelector of course ...

Also, while we still have categories in the apps view, I think we need to hide the workspace switcher there as well - having the narrow dash on the left and a rather large "side area" of categories and switcher on the right looks very unbalanced to me. Given that we don't support dragging app launchers to categories, I suggest to let the workspace switcher slide in when starting a drag.


[0] http://git.gnome.org/browse/gnome-shell-design/plain/mockups/static/search-results.png
Comment 32 Florian Müllner 2012-08-24 14:33:43 UTC
A small addition:
I was looking at this patch set, because landing it at least partially would probably allow us to not use a private property from the outside in bug 582650. While I really like the changes here, there is quite a bit of work left - as we are in beta now, I think we should focus on fixing up message-tray/lock-screen issues rather than landing this for 3.6. At least it would give us something to look forward to for 3.8 :-)
Comment 33 Jasper St. Pierre (not reading bugmail) 2012-08-24 18:24:49 UTC
(In reply to comment #31)
> (In reply to comment #23)
> > Preferably, I'd like to see the overview become a horizontal StBoxLayout or a
> > custom LayoutManager or something, split between the dash, the view selector,
> > and the workspace thumbnails.
> 
> I don't think this is an option - looking at the mockups[0], the viewSelector
> needs to extend to the right monitor edge (below the workspace switcher, if it
> is visible). For symmetry reasons (and in preparation for a nicer apps-view
> animation), it probably makes sense to do the same for the dash.

I don't see what's impossible about this. During the apps view, we have dash, window switcher, workspace switcher with BoxLayout. When we have search, we hide the dash and the workspace switcher, leaving only the window switcher, which is Stack'd out to become search results, which expands the full length of the screen.
Comment 34 Tanner Doshier 2012-08-28 17:22:37 UTC
Created attachment 222649 [details] [review]
overview and others: Rename item-drag signals to app-drag

Since results other than apps should not be draggable, be more descriptive and
rename item-drag signals to app-drag signals.

--

I'm not convinced it's a superb idea either, but the design asks for it so we
can see if we like it in practice.
Comment 35 Tanner Doshier 2012-08-28 17:23:07 UTC
Created attachment 222650 [details] [review]
dash: Add show/hide methods
Comment 36 Tanner Doshier 2012-08-28 17:25:13 UTC
Created attachment 222651 [details] [review]
dash: fix for shrinking dash while animating

The this.actor.height > this._maxHeight check is needed because animating the
dash out causes constant notify::height signals and so after each one the max
height would shrink to the actor height causing the icons to shrink until
eventually we get to 16px icons. This way, only increase maxHeight if the
actor can be drawn bigger than it is currently set.

--

Not sure why it does it either. Could it be due to the Clutter constraint we
add to dash.actor in the overview?

Changes:
 * Split from dash hide/show commit
Comment 37 Tanner Doshier 2012-08-28 17:26:30 UTC
Created attachment 222652 [details] [review]
workspaceThumbnail: Fix typo, removeThumbmails --> removeThumbnails

--

Changes:
  * Change it in workspacesDisplay as well.
Comment 38 Tanner Doshier 2012-08-28 17:27:40 UTC
Created attachment 222653 [details] [review]
workspaceThumbnail: Make ThumbnailsBox track workspace changes itself

--

Changes:
  * Squash in removal of duplicated parts in workspacesView.
Comment 39 Tanner Doshier 2012-08-28 17:28:13 UTC
Created attachment 222654 [details] [review]
workspaceThumbnail: React to scroll event

--

Changes:
 * Squash in removal of duplicate parts in workspacesView.
Comment 40 Tanner Doshier 2012-08-28 17:29:30 UTC
Created attachment 222655 [details] [review]
workspaceThumbnail: Rename show(), hide() and add new methods

show() and hide() now slide the thumbnails in and out, respectively. The old
show and hide are now _createThumbnails and _destroyThumbnails. We only care
about these thumbnails while in the overview, so create them when entering and
destroy them on exit.

--

Changes:
 * Cleanup
 * Rename to _computeThumbnailsX
Comment 41 Tanner Doshier 2012-08-28 17:33:59 UTC
Created attachment 222656 [details] [review]
workspaceThumbnail: Add keyboard nav to ThumbnailsBox

--

Up/Down moves workspaces and enter leaves the overview (to the workspace you
have moved to). I suppose we could switch to where up/down just move which
workspace is highlighted (not actually showing its windows in the overview)
and enter switches to it (still in the overview), but that doesn't seem too
helpful to me.
Comment 42 Tanner Doshier 2012-08-28 17:40:46 UTC
Created attachment 222657 [details] [review]
overview, workspacesView: Use ThumbnailsBox for independent workspace thumbnails

Both WorkspacesDisplay and ThumbnailsBox need to know when windows have been
restacked. Instead of each tracking changes on their own or trying to call
each other, have the overview keep track and do the calculations, emitting
a signal with the result.

--

Changes:
 * Keep the dash and thumbnailsBox private.
 * Make the overview track the 'restacked' signal and emit its own signal for
     WorkspacesView and ThumbnailsBox to tie into. This is to avoid each
     tracking 'restacked' on their own and doing the same calculation
     separately. Not sure I like this approach though.
 * Squash in removal of duplicate parts in WorkspacesView.
Comment 43 Tanner Doshier 2012-08-28 17:42:18 UTC
Created attachment 222658 [details] [review]
viewSelector: Return a new constraint to those that ask

Every actor requesting a constraint needs a new one, they can't all share the
same one.

--

No changes (besides being rebased, which removed the need for constrainY).
Comment 44 Tanner Doshier 2012-08-28 17:44:39 UTC
Created attachment 222660 [details] [review]
viewSelector, overview: Add search signals and connect them to hide/show

Hide the elements when the search entry is non-empty. Show them if the search
is cancelled.

--

Changes:
 * Add both search signals to viewSelector (search-begin was removed with 
     mode-kill).
 * Have the overview connect to the search signals from viewSelector and
     manage its own elements.
Comment 45 Tanner Doshier 2012-08-28 17:45:43 UTC
Created attachment 222661 [details] [review]
overview: Connect app-drag signals to show/hide overview elements

Anytime we begin dragging an app launcher, ensure the overview elements are
showing. While searching, if an app-drag ends or is cancelled, hide the
overview elements, but don't switch back to windows (which was the old
behavior).

--

Changes:
 * Move signal handling and connected hide/show to overview.
Comment 46 Tanner Doshier 2012-08-28 17:51:48 UTC
Created attachment 222665 [details] [review]
messageTray, viewSelector: show/hide message tray on search signals

--

The design calls for the message tray to be hidden while searching. I know the
new message tray behavior is could still be subject to change so maybe we
won't even need this patch if we aren't going to show the message tray by
default in the overview (and if they manually call for the message tray to be
shown we should probably respect that even while searching). Ideally, having
it hidden allows us to reclaim that vertical space for some more results and
just helps visually declutter the interface/keeps focus on the results.
Comment 47 Tanner Doshier 2012-08-28 17:58:25 UTC
Created attachment 222670 [details] [review]
viewSelector: this.active --> this.entryNonEmpty

'active' isn't terribly clear about just what is active, this variable is
true/false depending on whether or not the search entry has text.

--

Maybe others don't agree. Of course, !nonempty is a bit confusing, so we could
switch to this.entryEmpty and toggle its state where it is currently used.
Comment 48 Tanner Doshier 2012-08-28 18:06:30 UTC
Created attachment 222672 [details] [review]
viewSelector: remove switching from search results on app-drag-begin

--

I'm not sure what our goal behavior is with the changes that came with the
mode-kill, but this keeps it how I had it before, with app-drag not triggering
showing of workspacesView. This also affects the apps view and as Florian
mentions, we probably want to hide the thumbnails when in the apps view and
have them come back into view on app-drag. The dash should stay visible so the
user can close the apps view by clicking the dash icon. That behavior is not
implemented yet.
Comment 49 Cosimo Cecchi 2013-01-24 04:14:20 UTC
I'm working on refreshing this patchset to master for 3.8.
Comment 50 Cosimo Cecchi 2013-02-13 17:49:13 UTC
Created attachment 235922 [details] [review]
workspaceThumbnail: pack ThumbnailsBox in the overview directly
Comment 51 Cosimo Cecchi 2013-02-13 17:49:22 UTC
Created attachment 235923 [details] [review]
workspaceThumbnail: add methods to show/hide

These slide the workspace selector in and out with an animation.
Comment 52 Cosimo Cecchi 2013-02-13 17:49:26 UTC
Created attachment 235924 [details] [review]
viewSelector: notify on active page changes

In order to do this, we also need to move the assignment of
this._activePage from the animation onComplete callback to the function
itself.
Comment 53 Cosimo Cecchi 2013-02-13 17:49:31 UTC
Created attachment 235925 [details] [review]
overview: set side controls visibility on view page change

For now use the same behavior as before - hide the workspace thumbnails
when showing the applications page.
Comment 54 Cosimo Cecchi 2013-02-13 17:49:36 UTC
Created attachment 235926 [details] [review]
workspace: include the close button overlap in the right side chrome

As we do for the top side; the border is overlaied in the top/right
corner.
Comment 55 Cosimo Cecchi 2013-02-13 17:49:41 UTC
Created attachment 235927 [details] [review]
workspacesView: simplify code

We always pass the same coordinates to setGeometry and setClipRect in
WorkspacesView; remove the latter to simplify code.
Comment 56 Cosimo Cecchi 2013-02-13 17:49:46 UTC
Created attachment 235928 [details] [review]
dash: add methods to show/hide

These slide the dash in and out with an animation.
Comment 57 Cosimo Cecchi 2013-02-13 17:49:50 UTC
Created attachment 235929 [details] [review]
overview: hide side controls when searching

Hide the elements when the search is active. Show them if the search
is cancelled.
Comment 58 Cosimo Cecchi 2013-02-13 17:49:55 UTC
Created attachment 235930 [details] [review]
dash: slide in on drag-begin
Comment 59 Cosimo Cecchi 2013-02-13 17:50:00 UTC
Created attachment 235931 [details] [review]
workspaceThumbnails: don't slide in for drag if hidden
Comment 60 Cosimo Cecchi 2013-02-13 17:50:05 UTC
Created attachment 235932 [details] [review]
viewSelector: don't change page on drag begin

We now slide in controls as appropriate when a drag is started.
Comment 61 Cosimo Cecchi 2013-02-13 17:51:00 UTC
This new patchset doesn't yet touch the message tray. I'd like to look at that behavior separately after this lands.
Comment 62 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:03:29 UTC
Review of attachment 235922 [details] [review]:

::: js/ui/workspaceThumbnail.js
@@ +496,3 @@
+        let child = actor.get_first_child();
+        if (child)
+            child.allocate(box, flags);

How is this different from an StBin / ClutterBinLayout?

@@ +510,3 @@
+        this._content.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
+        this._content.connect('allocate', Lang.bind(this, this._allocate));
+        this._content._delegate = this;

Seems silly we have a custom layout manager and a generic container, but OK.
Comment 63 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:03:55 UTC
Review of attachment 235923 [details] [review]:

OK.
Comment 64 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:07:45 UTC
Review of attachment 235924 [details] [review]:

OK.
Comment 65 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:08:39 UTC
Review of attachment 235925 [details] [review]:

OK.
Comment 66 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:09:05 UTC
Review of attachment 235926 [details] [review]:

OK.
Comment 67 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:09:59 UTC
Review of attachment 235927 [details] [review]:

Yes.
Comment 68 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:13:44 UTC
Review of attachment 235928 [details] [review]:

::: js/ui/dash.js
@@ +367,3 @@
+const DashFixedLayout = new Lang.Class({
+    Name: 'DashFixedLayout',
+    Extends: Clutter.FixedLayout,

I think this can be done with a ClutterBinLayout with y_align set to Clutter.ActorAlign.CENTER.

@@ +424,3 @@
         this._container.add_actor(this._showAppsIcon.actor);
 
+        this.actor = new St.Widget({ layout_manager: new DashFixedLayout(),

I don't think the layout manager is relevant to sliding -- is it?
Comment 69 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:18:29 UTC
Review of attachment 235929 [details] [review]:

::: js/ui/overview.js
@@ +277,3 @@
+
+        let dashVisible = !searchActive;
+        let thumbnailsVisible = !searchActive && !appsActive;

I wonder if this might be clearer in terms of what pages there are. I know the view selector / page system is a bit weird, but maybe:

const CurrentView = {
    WINDOWS: 1,
    APPS: 2,
    SEARCH: 3
};

...

let currentView = viewSelector.getCurrentView();

let dashVisible = (currentView == ViewSelector.CurrentView.WINDOWS ||
                   currentView == ViewSelector.CurrentView.APPS);
let thumbsVisible = (currentView == ViewSelector.CurrentView.WINDOWS);

...

You can still do this in terms of three booleans (getWindowsActive, getAppsActive, getSearchActive) if you don't like the enum.
Comment 70 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:19:27 UTC
Review of attachment 235930 [details] [review]:

I like this.
Comment 71 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:20:23 UTC
Review of attachment 235931 [details] [review]:

::: js/ui/workspaceThumbnail.js
@@ +601,1 @@
             (this._visible && global.screen.n_workspaces > 2);

The actor can't have hover either if it's invisible, so it makes sense to do:

   if (!this._visible || !alwaysZoomOut)

or something (I can't see the code paths below)
Comment 72 Jasper St. Pierre (not reading bugmail) 2013-02-13 18:21:27 UTC
Review of attachment 235932 [details] [review]:

OK.
Comment 73 Cosimo Cecchi 2013-02-13 22:56:37 UTC
(In reply to comment #62)

> ::: js/ui/workspaceThumbnail.js
> @@ +496,3 @@
> +        let child = actor.get_first_child();
> +        if (child)
> +            child.allocate(box, flags);
> 
> How is this different from an StBin / ClutterBinLayout?

It is, as those will allocate the preferred child size as far as I can see.
For how the WorkspaceThumbnails actor currently works, we need to give the full allocatin to the child instead (which doesn't report a sane preferred size).

> @@ +510,3 @@
> +        this._content.connect('get-preferred-height', Lang.bind(this,
> this._getPreferredHeight));
> +        this._content.connect('allocate', Lang.bind(this, this._allocate));
> +        this._content._delegate = this;
> 
> Seems silly we have a custom layout manager and a generic container, but OK.

Yeah, I have no doubt this could be simplified somehow, but I don't feel like spending even more time chasing the perfect actor configuration that gets us to the same result. I'd be glad to work on symplifying this whole layout more after we land this.
Comment 74 Cosimo Cecchi 2013-02-13 22:58:52 UTC
(In reply to comment #68)
> Review of attachment 235928 [details] [review]:
> 
> ::: js/ui/dash.js
> @@ +367,3 @@
> +const DashFixedLayout = new Lang.Class({
> +    Name: 'DashFixedLayout',
> +    Extends: Clutter.FixedLayout,
> 
> I think this can be done with a ClutterBinLayout with y_align set to
> Clutter.ActorAlign.CENTER.

Won't work, see below.

> @@ +424,3 @@
>          this._container.add_actor(this._showAppsIcon.actor);
> 
> +        this.actor = new St.Widget({ layout_manager: new DashFixedLayout(),
> 
> I don't think the layout manager is relevant to sliding -- is it?

It is; we need a fixed layout - we discussed why this was the case in person previously. In a nutshell, if we don't use a fixed layout, the contents will be allocated with keep their position while sliding out, instead of moving with the parent layout.
Again, the same rationale from the previous comment applies here as well.

I'll attach a new patchset that fixes the other points.
Comment 75 Cosimo Cecchi 2013-02-13 23:01:19 UTC
Created attachment 235961 [details] [review]
viewSelector: add a method to get the currently active page
Comment 76 Cosimo Cecchi 2013-02-13 23:01:46 UTC
Created attachment 235962 [details] [review]
overview: set side controls visibility on view page change

For now use the same behavior as before - hide the workspace thumbnails
when showing the applications page.
Comment 77 Cosimo Cecchi 2013-02-13 23:02:11 UTC
Created attachment 235963 [details] [review]
overview: hide side controls when searching

Hide the elements when the search is active. Show them if the search
is cancelled.
Comment 78 Cosimo Cecchi 2013-02-13 23:04:58 UTC
Created attachment 235964 [details] [review]
dash: add methods to show/hide

These slide the dash in and out with an animation.
Comment 79 Cosimo Cecchi 2013-02-13 23:08:30 UTC
Created attachment 235965 [details] [review]
workspaceThumbnail: add methods to show/hide

These slide the workspace selector in and out with an animation.
Comment 80 Jasper St. Pierre (not reading bugmail) 2013-02-13 23:19:15 UTC
(In reply to comment #73)
> (In reply to comment #62)
> 
> > ::: js/ui/workspaceThumbnail.js
> > @@ +496,3 @@
> > +        let child = actor.get_first_child();
> > +        if (child)
> > +            child.allocate(box, flags);
> > 
> > How is this different from an StBin / ClutterBinLayout?
> 
> It is, as those will allocate the preferred child size as far as I can see.
> For how the WorkspaceThumbnails actor currently works, we need to give the full
> allocatin to the child instead (which doesn't report a sane preferred size).

http://git.gnome.org/browse/clutter/tree/clutter/clutter-bin-layout.c#n428

It seems it passes it the full allocation. There's a bit of complication related to clutter_actor_allocate_align_full, but setting the actor's x_expand and y_expand to TRUE will make it use the actor's x_align/y_align layout flags, which by default are CLUTTER_ACTOR_ALIGN_FILL, which shouldn't have any issues. Grep around for BinLayout and you should see people using it on actors that have x_expand/y_expand set to TRUE with a comment describing the hack. We do it already.
Comment 81 Cosimo Cecchi 2013-02-14 04:07:08 UTC
Created attachment 235983 [details] [review]
workspaceThumbnail: pack ThumbnailsBox in the overview directly

--

Now using a stock ClutterBinLayout.
Comment 82 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:12:34 UTC
Review of attachment 235983 [details] [review]:

Much better.
Comment 83 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:13:32 UTC
Review of attachment 235961 [details] [review]:

::: js/ui/viewSelector.js
@@ +475,3 @@
+
+    getActivePage: function() {
+        if (this._activePage == this._workspacesPage)

Perhaps later we should store this on the view selector itself instead of using activePage comparisons, but for now this is fine.

@@ +476,3 @@
+    getActivePage: function() {
+        if (this._activePage == this._workspacesPage)
+            return ViewPage.WINDOWS

Missing semi.
Comment 84 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:14:43 UTC
Review of attachment 235962 [details] [review]:

::: js/ui/overview.js
@@ +274,3 @@
+
+        let activePage = this._viewSelector.getActivePage();
+        let thumbnailsVisible = (activePage != ViewSelector.ViewPage.APPS);

I think I like (activePage == ViewSelector.ViewPage.WINDOWS || activePage == ViewSelector.ViewPage.SEARCH); better, and then we'll take that second part out later.
Comment 85 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:15:22 UTC
Review of attachment 235963 [details] [review]:

OK when rebased.
Comment 86 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:16:08 UTC
Review of attachment 235965 [details] [review]:

OK.
Comment 87 Jasper St. Pierre (not reading bugmail) 2013-02-14 04:17:13 UTC
Review of attachment 235964 [details] [review]:

If you don't come up with an alternate strategy for this either tonight or tomorrow, feel free to commit. I'd still like to try to replace this with something a bit more standard, though.
Comment 88 Cosimo Cecchi 2013-02-14 21:11:52 UTC
Created attachment 236158 [details] [review]
Introduce a SlideLayout layout manager

SlideLayout is a fixed layout that takes care of requesting and
allocating the right sizes so its contents can slide horizontally as the
actor is resized.
Sliding is controlled with a slideX and slideDirection properties, which
do the right thing wrt. RTL automatically.
Comment 89 Cosimo Cecchi 2013-02-14 21:12:19 UTC
Created attachment 236161 [details] [review]
workspaceThumbnail: pack ThumbnailsBox in the overview directly
Comment 90 Cosimo Cecchi 2013-02-14 21:12:59 UTC
Created attachment 236162 [details] [review]
overview: set side controls visibility on view page change

For now use the same behavior as before - hide the workspace thumbnails
when showing the applications page.
Comment 91 Cosimo Cecchi 2013-02-14 21:13:17 UTC
Created attachment 236163 [details] [review]
dash: add methods to show/hide

These slide the dash in and out with an animation.
Comment 92 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:18:06 UTC
Review of attachment 236158 [details] [review]:

Minor nit, otherwise fine. Nice and clean :)

::: js/ui/slideLayout.js
@@ +26,3 @@
+        let rtl = (child.text_direction == Clutter.TextDirection.RTL);
+        if (rtl)
+            direction = !direction;

Not sure I like this. I'd prefer to have:

if (rtl)
    direction = (direction == SlideDirection.LEFT) ? SlideDirection.RIGHT : SlideDirection.LEFT;

or something.
Comment 93 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:20:01 UTC
Review of attachment 236161 [details] [review]:

Yes.
Comment 94 Jasper St. Pierre (not reading bugmail) 2013-02-14 21:22:13 UTC
Review of attachment 236163 [details] [review]:

I was imagining that the SlideLayout would be in the overview (along with the thumbnails, but that's a bit special). I think it's a bit better to have it there for the dash for now.
Comment 95 Cosimo Cecchi 2013-02-14 22:53:34 UTC
Created attachment 236186 [details] [review]
Introduce a SlideLayout layout manager

SlideLayout is a fixed layout that takes care of requesting and
allocating the right sizes so its contents can slide horizontally as the
actor is resized.
Sliding is controlled with a slideX and slideDirection properties, which
do the right thing wrt. RTL automatically.

Also add a SlidingControl base class that will be used by the overview
to pack and slide the workspace thumbnail switcher and the dash.
Comment 96 Cosimo Cecchi 2013-02-14 22:53:40 UTC
Created attachment 236187 [details] [review]
workspaceThumbnail: pack ThumbnailsBox in the overview directly

Use a SlidingControl subclass and pack that in the overview group
directly.
Comment 97 Cosimo Cecchi 2013-02-14 22:53:45 UTC
Created attachment 236188 [details] [review]
viewSelector: notify on active page changes

In order to do this, we also need to move the assignment of
this._activePage from the animation onComplete callback to the function
itself.
Comment 98 Cosimo Cecchi 2013-02-14 22:53:51 UTC
Created attachment 236189 [details] [review]
viewSelector: add a method to get the currently active page
Comment 99 Cosimo Cecchi 2013-02-14 22:53:59 UTC
Created attachment 236190 [details] [review]
overview: set side controls visibility on view page change

For now use the same behavior as before - hide the workspace thumbnails
when showing the applications page.
Comment 100 Cosimo Cecchi 2013-02-14 22:54:05 UTC
Created attachment 236191 [details] [review]
workspace: include the close button overlap in the right side chrome

As we do for the top side; the border is overlaied in the top/right
corner.
Comment 101 Cosimo Cecchi 2013-02-14 22:54:10 UTC
Created attachment 236192 [details] [review]
workspacesView: simplify code

We always pass the same coordinates to setGeometry and setClipRect in
WorkspacesView; remove the latter to simplify code.
Comment 102 Cosimo Cecchi 2013-02-14 22:54:15 UTC
Created attachment 236193 [details] [review]
dash: add a SlidingControl for the dash actor

Will be needed to hide and show it when searching.
Comment 103 Cosimo Cecchi 2013-02-14 22:54:22 UTC
Created attachment 236194 [details] [review]
overview: hide side controls when searching

Hide the elements when the search is active. Show them if the search
is cancelled.
Comment 104 Cosimo Cecchi 2013-02-14 22:54:28 UTC
Created attachment 236195 [details] [review]
viewSelector: don't change page on drag begin

We now slide in controls as appropriate when a drag is started.
Comment 105 Cosimo Cecchi 2013-02-14 22:56:06 UTC
Reattached full patchset (with previous a-c-n statuses) for clarity.
Comment 106 Jasper St. Pierre (not reading bugmail) 2013-02-14 22:59:24 UTC
Review of attachment 236186 [details] [review]:

Fine to commit with this fixed.

::: js/ui/overviewControls.js
@@ +30,3 @@
+        let rtl = (child.text_direction == Clutter.TextDirection.RTL);
+        if (rtl)
+            direction = !direction;

Please fix this.
Comment 107 Jasper St. Pierre (not reading bugmail) 2013-02-14 23:00:32 UTC
Review of attachment 236187 [details] [review]:

OK.
Comment 108 Jasper St. Pierre (not reading bugmail) 2013-02-14 23:01:56 UTC
Review of attachment 236193 [details] [review]:

::: js/ui/overviewControls.js
@@ +211,3 @@
+        this.dash = dash;
+        dash.actor.x_expand = true;
+        dash.actor.y_expand = true;

You should add a comment saying that this is the standard BinLayout hack.
Comment 109 Cosimo Cecchi 2013-02-14 23:19:33 UTC
All pushed with the suggested changes. Thanks everyone for the reviews, let's wait for the fallout now :)

Attachment 236186 [details] pushed as 93bde0c - Introduce a SlideLayout layout manager
Attachment 236187 [details] pushed as 3d8a875 - workspaceThumbnail: pack ThumbnailsBox in the overview directly
Attachment 236188 [details] pushed as f2edcb9 - viewSelector: notify on active page changes
Attachment 236189 [details] pushed as 4016da6 - viewSelector: add a method to get the currently active page
Attachment 236190 [details] pushed as 5b39496 - overview: set side controls visibility on view page change
Attachment 236191 [details] pushed as bc75e5e - workspace: include the close button overlap in the right side chrome
Attachment 236192 [details] pushed as c550e2c - workspacesView: simplify code
Attachment 236193 [details] pushed as 2247065 - dash: add a SlidingControl for the dash actor
Attachment 236194 [details] pushed as 45415a7 - overview: hide side controls when searching
Attachment 236195 [details] pushed as f7512dc - viewSelector: don't change page on drag begin