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 694261 - Applications grid isn't horizontally centered
Applications grid isn't horizontally centered
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: overview
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
3.8?
: 694260 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-20 13:03 UTC by Allan Day
Modified: 2013-03-01 17:26 UTC
See Also:
GNOME target: 3.8
GNOME version: ---


Attachments
overview: Move dash to a separate layer (4.89 KB, patch)
2013-02-21 18:50 UTC, Florian Müllner
accepted-commit_now Details | Review
overviewControls: Make DashSpacer fancier (2.54 KB, patch)
2013-02-21 18:50 UTC, Florian Müllner
reviewed Details | Review
overviewControls: Make DashSpacer fancier (2.52 KB, patch)
2013-02-21 18:56 UTC, Florian Müllner
reviewed Details | Review
appDisplay: Center AllView content (1.76 KB, patch)
2013-02-21 21:59 UTC, Florian Müllner
none Details | Review
st-scroll-view: Add :overlay-scrollbars property (7.00 KB, patch)
2013-02-21 21:59 UTC, Florian Müllner
reviewed Details | Review
appDisplay: Center AllView content (1.82 KB, patch)
2013-02-21 21:59 UTC, Florian Müllner
none Details | Review
appDisplay: Center AllView content (1.82 KB, patch)
2013-02-21 23:10 UTC, Florian Müllner
none Details | Review
appDisplay: Apply the same padding to AllView and FrequentView (1.16 KB, patch)
2013-02-21 23:10 UTC, Florian Müllner
none Details | Review
appDisplay: Center AllView content (1.82 KB, patch)
2013-02-22 01:37 UTC, Florian Müllner
none Details | Review
appDisplay: Apply the same padding to AllView and FrequentView (1.16 KB, patch)
2013-02-22 01:37 UTC, Florian Müllner
none Details | Review
st-scroll-view: Add :overlay-scrollbars property (8.23 KB, patch)
2013-02-22 09:04 UTC, Florian Müllner
committed Details | Review
appDisplay: Center AllView content (1.78 KB, patch)
2013-02-22 09:05 UTC, Florian Müllner
committed Details | Review
appDisplay: Apply the same padding to AllView and FrequentView (1.16 KB, patch)
2013-02-22 09:06 UTC, Florian Müllner
committed Details | Review
overview: Move dash to a separate layer (5.62 KB, patch)
2013-02-22 09:54 UTC, Florian Müllner
committed Details | Review

Description Allan Day 2013-02-20 13:03:58 UTC
This is a pretty obvious issue with the new applications view.

It might be a more generic issue with horizontal alignment in the overview. A few other examples where horizontal centering is lacking:

 * Dragging a launcher from search results causes the dash to slide in. The search results respond by moving across - they should stay in their centered position.

 * In the window selector view, if the window thumbnails are narrower than the available space they aren't centered in the middle of the screen, but are instead positioned half-way between the dash and workspace switcher. It *might* be better if they made an effort to be centered (I'm not entirely sure on this point).
Comment 1 Florian Müllner 2013-02-20 13:45:18 UTC
(In reply to comment #0)
> It might be a more generic issue with horizontal alignment in the overview.

Yup. The content part (window picker, app picker, search results) are centered between the dash's right edge and the right monitor edge. Or in other words: when the dash is visible, it's not centered at all.

The correct solution is probably to actually layer the dash on top of the content. (I'll take a look into that post-release).
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-20 16:41:21 UTC
(In reply to comment #0)
>  * In the window selector view, if the window thumbnails are narrower than the
> available space they aren't centered in the middle of the screen, but are
> instead positioned half-way between the dash and workspace switcher. It *might*
> be better if they made an effort to be centered (I'm not entirely sure on this
> point).

We've tried this. It looks... bad.

(In reply to comment #1)
> The correct solution is probably to actually layer the dash on top of the
> content. (I'll take a look into that post-release).

... except in the window picker case
Comment 3 Florian Müllner 2013-02-21 18:50:04 UTC
Created attachment 237092 [details] [review]
overview: Move dash to a separate layer

We generally want view content centered, in particular where the
view itself is symmetrical. So move the dash to a separate layer
and use a placeholder to account for its size when showing the
window picker, which is the only view where it doesn't make sense
to center the content.
Comment 4 Florian Müllner 2013-02-21 18:50:09 UTC
Created attachment 237093 [details] [review]
overviewControls: Make DashSpacer fancier

Make dash-actor a GObject property, which is a bit fancier :-)
To be merged with the previous patch if we consider it a good idea,
or dropped otherwise.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-02-21 18:53:32 UTC
Review of attachment 237093 [details] [review]:

::: js/ui/overviewControls.js
@@ +335,3 @@
     Extends: St.Widget,
+    Properties: {
+        'dash_actor': GObject.ParamSpec._new_internal('dash-actor', GObject.type_from_name('ClutterActor'), 'dash-actor', 'dash-actor', GObject.ParamFlags.WRITABLE, null, null, null)

You should just be able to use Clutter.Actor here and have everything work out.
Comment 6 Florian Müllner 2013-02-21 18:56:54 UTC
Created attachment 237094 [details] [review]
overviewControls: Make DashSpacer fancier

Cool, that's helpful.
Comment 7 Florian Müllner 2013-02-21 21:59:03 UTC
Created attachment 237115 [details] [review]
appDisplay: Center AllView content

If the AllView is scrolled, the vertical scrollbar will take away
some horizontal space on one side, resulting in the content ending
up slightly off-center.
Account for this by setting appropriate padding on the opposite
side.

(This is the non-fancy variant)
Comment 8 Florian Müllner 2013-02-21 21:59:30 UTC
Created attachment 237116 [details] [review]
st-scroll-view: Add :overlay-scrollbars property

If enabled, scrollbars take away from the allocation given to the
view's content. This is usually preferrable to painting the bars on
top of the content, but there are exceptions, for instance when the
content needs to be centered with regard to the view as a whole.
Add a :overlay-scrollbars property to account for those cases.
Comment 9 Florian Müllner 2013-02-21 21:59:45 UTC
Created attachment 237117 [details] [review]
appDisplay: Center AllView content

If the AllView is scrolled, the vertical scrollbar will take away
some horizontal space on one side, resulting in the content ending
up slightly off-center.
Account for this by using overlay-scrollbars instead.


(This is the fancy variant)
Comment 10 Florian Müllner 2013-02-21 23:10:47 UTC
Created attachment 237123 [details] [review]
appDisplay: Center AllView content

Rebased to master.
Comment 11 Florian Müllner 2013-02-21 23:10:53 UTC
Created attachment 237124 [details] [review]
appDisplay: Apply the same padding to AllView and FrequentView

We add some horizontal padding to the AllView's content to make
sure content does not end up underneath the scrollbar; while this
is not required in case of the FrequentView which does not have
a scrollbar, applying the same padding ensures that both views
end up with the same spacing, which makes switching between them
less disruptive.
Comment 12 Florian Müllner 2013-02-22 01:37:14 UTC
Created attachment 237133 [details] [review]
appDisplay: Center AllView content

Fix CSS.
Comment 13 Florian Müllner 2013-02-22 01:37:30 UTC
Created attachment 237134 [details] [review]
appDisplay: Apply the same padding to AllView and FrequentView

Fix CSS.
Comment 14 drago01 2013-02-22 08:53:25 UTC
Review of attachment 237116 [details] [review]:

Looks good, but you should probably add a test in tests/scroll-view-sizing.js (we do have tests for all other properties here).
Comment 15 Florian Müllner 2013-02-22 09:04:59 UTC
Created attachment 237149 [details] [review]
st-scroll-view: Add :overlay-scrollbars property

Good point, added test case.
Comment 16 Florian Müllner 2013-02-22 09:05:58 UTC
Created attachment 237150 [details] [review]
appDisplay: Center AllView content

Rebase to master
Comment 17 Florian Müllner 2013-02-22 09:06:20 UTC
Created attachment 237151 [details] [review]
appDisplay: Apply the same padding to AllView and FrequentView

Rebase to master
Comment 18 drago01 2013-02-22 09:08:26 UTC
Review of attachment 237092 [details] [review]:

Looks good.
Comment 19 drago01 2013-02-22 09:09:45 UTC
Review of attachment 237149 [details] [review]:

Looks good.
Comment 20 Florian Müllner 2013-02-22 09:10:28 UTC
*** Bug 694260 has been marked as a duplicate of this bug. ***
Comment 21 drago01 2013-02-22 09:11:10 UTC
Review of attachment 237094 [details] [review]:

::: js/ui/overviewControls.js
@@ +334,3 @@
     Extends: St.Widget,
+    Properties: {
+        'dash_actor': GObject.ParamSpec._new_internal('dash-actor', Clutter.Actor, 'dash-actor', 'dash-actor', GObject.ParamFlags.WRITABLE, null, null, null)

Line breaks might not be a bad idea here ;)
Comment 22 drago01 2013-02-22 09:11:58 UTC
Review of attachment 237150 [details] [review]:

OK.
Comment 23 drago01 2013-02-22 09:12:36 UTC
Review of attachment 237151 [details] [review]:

Makes sense.
Comment 24 Florian Müllner 2013-02-22 09:54:38 UTC
Created attachment 237156 [details] [review]
overview: Move dash to a separate layer

Turned out that the previous patch messed up the transition from app-picker to normal mode (e.g. <super>a - <super>).
Comment 25 Florian Müllner 2013-02-22 09:57:19 UTC
(In reply to comment #21)
>      Extends: St.Widget,
> +    Properties: {
> +        'dash_actor': GObject.ParamSpec._new_internal('dash-actor',
> Clutter.Actor, 'dash-actor', 'dash-actor', GObject.ParamFlags.WRITABLE, null,
> null, null)
> 
> Line breaks might not be a bad idea here ;)

Right, fixed locally. I'd still like some feedback from Jasper on whether he considers GObject properties safe to use before squashing this.
Comment 26 Florian Müllner 2013-02-22 09:59:01 UTC
Attachment 237149 [details] pushed as 1bd8c67 - st-scroll-view: Add :overlay-scrollbars property
Attachment 237150 [details] pushed as 6ea8f35 - appDisplay: Center AllView content
Attachment 237151 [details] pushed as 62ca4ba - appDisplay: Apply the same padding to AllView and FrequentView
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-02-22 16:22:25 UTC
(In reply to comment #25)
> Right, fixed locally. I'd still like some feedback from Jasper on whether he
> considers GObject properties safe to use before squashing this.

We use them in MonitorConstraint, so they're safe in terms of runtime. I don't really see the utility of bouncing through GObect for this.

_new_internal API may go away at some point (if we add fundamentals support and use the native g_param_spec_* functions), but we probably really should add GObject.ParamSpec.new_object or something.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-03-01 02:44:05 UTC
Review of attachment 237156 [details] [review]:

::: js/ui/overviewControls.js
@@ +348,3 @@
+        if (dashActor) {
+            this._bindConstraint = new Clutter.BindConstraint({ source: dashActor,
+                                                                coordinate: Clutter.BindCoordinate.SIZE });

Are we sure the bind constraint is the best idea? It's given us nothing but allocation warnings in the past...
Comment 29 Florian Müllner 2013-03-01 02:46:34 UTC
(In reply to comment #28)
> Are we sure the bind constraint is the best idea? It's given us nothing but
> allocation warnings in the past...

That was an align constraint, I've been running with this patch for a while now without any allocation warnings.
Comment 30 Florian Müllner 2013-03-01 15:28:32 UTC
(In reply to comment #29)
> (In reply to comment #28)
> > Are we sure the bind constraint is the best idea? It's given us nothing but
> > allocation warnings in the past...
> 
> That was an align constraint, I've been running with this patch for a while now
> without any allocation warnings.

I've just tested explicitly for dash size changes without warnings.
Comment 31 drago01 2013-03-01 16:06:39 UTC
(In reply to comment #28)
> Review of attachment 237156 [details] [review]:
> 
> ::: js/ui/overviewControls.js
> @@ +348,3 @@
> +        if (dashActor) {
> +            this._bindConstraint = new Clutter.BindConstraint({ source:
> dashActor,
> +                                                                coordinate:
> Clutter.BindCoordinate.SIZE });
> 
> Are we sure the bind constraint is the best idea? It's given us nothing but
> allocation warnings in the past...

Huh?
why would a constraint cause allocation warnings? If anything it avoids them ...

We had issue like binding to the stage / uiGroup causing full screen redraws but I can't recall constraints ever causing allocation loops (there purpose is to avoid them).
Comment 32 Florian Müllner 2013-03-01 16:09:47 UTC
(In reply to comment #31)
> Huh?
> why would a constraint cause allocation warnings? If anything it avoids them
> ...

Not in every case, unfortunately: http://git.gnome.org/browse/gnome-shell/commit?id=95602eb85d167c9
Comment 33 drago01 2013-03-01 16:15:37 UTC
(In reply to comment #32)
> (In reply to comment #31)
> > Huh?
> > why would a constraint cause allocation warnings? If anything it avoids them
> > ...
> 
> Not in every case, unfortunately:
> http://git.gnome.org/browse/gnome-shell/commit?id=95602eb85d167c9

OK, but there the reason was that the constraint referenced one of the actors parents. (So it changed the allocation of the children caused the parent to reallocate caused the constraint to fire .... )
Comment 34 Florian Müllner 2013-03-01 16:19:25 UTC
Yeah, I'm not arguing against using a constraint in *this* bug, which is a different case (and should be completely fine) ...
Comment 35 Jasper St. Pierre (not reading bugmail) 2013-03-01 16:41:35 UTC
Review of attachment 237156 [details] [review]:

OK.
Comment 36 Florian Müllner 2013-03-01 17:26:23 UTC
Attachment 237156 [details] pushed as cca008b - overview: Move dash to a separate layer