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 690171 - Overview: Make Workspace manage its own padding
Overview: Make Workspace manage its own padding
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-12-13 18:32 UTC by Giovanni Campagna
Modified: 2013-01-18 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Overview: Make Workspace manage its own padding (7.31 KB, patch)
2012-12-13 18:32 UTC, Giovanni Campagna
needs-work Details | Review
ViewSelector: use Params to pass optional parameters to addPage (3.02 KB, patch)
2012-12-13 22:25 UTC, Giovanni Campagna
none Details | Review
ViewSelector: remove unnecessary StBoxLayout (1.65 KB, patch)
2012-12-13 22:25 UTC, Giovanni Campagna
committed Details | Review
Overview: Make Workspace manage its own padding (4.55 KB, patch)
2012-12-13 22:25 UTC, Giovanni Campagna
none Details | Review
ViewSelector: use Params to pass optional parameters to addPage (3.12 KB, patch)
2012-12-13 22:34 UTC, Giovanni Campagna
committed Details | Review
Overview: Make Workspace manage its own padding (7.06 KB, patch)
2012-12-15 15:08 UTC, Giovanni Campagna
reviewed Details | Review
Overview: apply extra padding to windows in external monitor (5.63 KB, patch)
2013-01-18 19:59 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-12-13 18:32:34 UTC
I know there is another bug for this somewhere, but I can't find it...
Comment 1 Giovanni Campagna 2012-12-13 18:32:37 UTC
Created attachment 231499 [details] [review]
Overview: Make Workspace manage its own padding

Move window clone padding down to LayoutStrategy, and apply it on both
sides of the computed layout.
Move spacing between the dash and the content down in the view selector
page, so it can be removed for the workspaces page.
This fixes spacing in multimonitor cases (as there the workspace gets
the full monitor as geometry), and fixes spacing between the clones and
the thumbnails box, without introducing an asymmetry in the layout code
to account for the overview-group spacing.
Comment 2 Florian Müllner 2012-12-13 19:20:04 UTC
Review of attachment 231499 [details] [review]:

Generally looks like a nice cleanup, but the unrelated parts need to be split out.

::: js/ui/viewSelector.js
@@ -41,3 @@
     _init : function(searchEntry, showAppsButton) {
-        this.actor = new St.BoxLayout({ name: 'viewSelector',
-                                        vertical: true });

Yeah, this is a left-over from the tabbed overview. Should be split out.

@@ +171,3 @@
     },
 
+    _addPage: function(actor, name, a11yIcon, params) {

Using Params for optional arguments makes sense, but should be a separate patch as well.
Comment 3 Giovanni Campagna 2012-12-13 22:25:21 UTC
Created attachment 231518 [details] [review]
ViewSelector: use Params to pass optional parameters to addPage

This allows to introduce new parameters without making the signature
overly complex.
Comment 4 Giovanni Campagna 2012-12-13 22:25:29 UTC
Created attachment 231519 [details] [review]
ViewSelector: remove unnecessary StBoxLayout

It was a remnant from the tabbed interface.
Comment 5 Giovanni Campagna 2012-12-13 22:25:43 UTC
Created attachment 231520 [details] [review]
Overview: Make Workspace manage its own padding

Move window clone padding down to LayoutStrategy, and apply it on both
sides of the computed layout.
Move spacing between the dash and the content down in the view selector
page, so it can be removed for the workspaces page.
This fixes spacing in multimonitor cases (as there the workspace gets
the full monitor as geometry), and fixes spacing between the clones and
the thumbnails box, without introducing an asymmetry in the layout code
to account for the overview-group spacing.
Comment 6 Giovanni Campagna 2012-12-13 22:34:54 UTC
Created attachment 231521 [details] [review]
ViewSelector: use Params to pass optional parameters to addPage

This allows to introduce new parameters without making the signature
overly complex.
Comment 7 Cosimo Cecchi 2012-12-14 15:15:04 UTC
I think we really need either this or the patch in bug 690174 to fix the missing spacing regression between the workspaces view and the selector controls.

While some patches in here would be nice to have regardless, if I understood correctly what attachment 231520 [details] [review] does (adding the spacing also on the external sides of the workspaces view), I think I would prefer fixing the bug with my patch in bug 690174: spacing is always intended in between children, not on the external sides of the container. Also, my patch can just be reverted once we further refactor how layouting works in the overview (which I do in a later patch related to the search results feature I'm working on).
Comment 8 Cosimo Cecchi 2012-12-14 15:17:35 UTC
Review of attachment 231518 [details] [review]:

::: js/ui/viewSelector.js
@@ +178,3 @@
     },
 
     _addPage: function(actor, a11yFocus, name, a11yIcon) {

Shouldn't you aldo change the signature to _addPage: function(actor, name, a11yIcon, params)?
Comment 9 Cosimo Cecchi 2012-12-14 15:18:58 UTC
Review of attachment 231519 [details] [review]:

LGTM
Comment 10 Cosimo Cecchi 2012-12-14 15:21:11 UTC
Comment on attachment 231518 [details] [review]
ViewSelector: use Params to pass optional parameters to addPage

Ah sorry this is obsoleted by the later one
Comment 11 Cosimo Cecchi 2012-12-14 15:21:44 UTC
Review of attachment 231521 [details] [review]:

LGTM
Comment 12 Giovanni Campagna 2012-12-14 15:35:03 UTC
(In reply to comment #7)
> I think we really need either this or the patch in bug 690174 to fix the
> missing spacing regression between the workspaces view and the selector
> controls.
> 
> While some patches in here would be nice to have regardless, if I understood
> correctly what attachment 231520 [details] [review] does (adding the spacing also on the external
> sides of the workspaces view), I think I would prefer fixing the bug with my
> patch in bug 690174: spacing is always intended in between children, not on the
> external sides of the container. Also, my patch can just be reverted once we
> further refactor how layouting works in the overview (which I do in a later
> patch related to the search results feature I'm working on).

It is actually intended to add the spacing on the external sides of the workspace view. Otherwise we need a patch to fix the geometry of workspaces on external monitors, since currently windows are allocated the full monitor size, with no padding. And to me, it looks cleaner to pass the full allocation to the layout code, and then decide there how to pad the content.
Comment 13 Cosimo Cecchi 2012-12-14 16:16:58 UTC
What I'm trying to say is that
- It's wrong to use "spacing" when you mean "padding" (i.e. the external one)
- I don't think it's a good idea to add padding-left to other overview pages. It makes things harder for RTL and we should just use the spacing in the container. Since the controls are possibly going to be separated from the WorkspaceDisplay actors and added directly to the overview horizontal group in the future, using spacing makes everything much easier.
- The external monitor issue seems different to me. Since on an external monitor we don't have any other UI elements, we might even use a different padding value altogether than in the overview. I think we should have a different style class for a workspace view on an external monitor.
Comment 14 Giovanni Campagna 2012-12-14 18:16:14 UTC
I agree with your points in principle, but your analisys of point 3 is wrong.
Unless we change the delicate geometry handling code in workspacesView.js, workspace.js needs to take care of adding padding itself, and the best place to do that is LayoutStrategy.
Now, I'm perfectly fine with adding another parameter (hpadding?), similar to bottomPadding, instead of reusing columnSpacing. But using spacing from the outside container looks just wrong to me.
Comment 15 Cosimo Cecchi 2012-12-14 22:26:55 UTC
I see your point, and I think supporting a padding around the workspace view actor is a good idea for future tweaks (and I think it should be a separate property, yeah).

On the other hand, right now WorkspacesDisplay is a container for two actors, the workspace views and the controls. I don't see any reason why we couldn't support spacing in such a container. After all, the patch in bug 690174 just adds back some code that was accidentally taken out in http://git.gnome.org/browse/gnome-shell/commit/?id=04d68c6e36dbd8b6d8933a5edea77d9ca15846e7
Comment 16 Giovanni Campagna 2012-12-15 14:20:16 UTC
Ok, so let's do both. The patch in bug 690174 is good to go, I'll update mine to account for separate padding properties (which would be 0 in the primary monitor, and non 0 outside)
Meanwhile, let me push the clean ups too.
Comment 17 Giovanni Campagna 2012-12-15 14:25:04 UTC
Comment on attachment 231519 [details] [review]
ViewSelector: remove unnecessary StBoxLayout

Attachment 231519 [details] pushed as be10f3c - ViewSelector: remove unnecessary StBoxLayout
Comment 18 Giovanni Campagna 2012-12-15 15:08:26 UTC
Created attachment 231622 [details] [review]
Overview: Make Workspace manage its own padding

Consolidate window clone padding application to Workspace, and pass the
padded area down to LayoutStrategy. The padding is now configurable
in CSS.
This allows us to fix spacing in multimonitor cases (as there the workspace gets
the full monitor as geometry), by adding a new style class to external
workspaces.

Ok, so now it deals with external monitors only.
Comment 19 Cosimo Cecchi 2013-01-18 19:10:54 UTC
Review of attachment 231521 [details] [review]:

++
Comment 20 Cosimo Cecchi 2013-01-18 19:25:22 UTC
Review of attachment 231622 [details] [review]:

Looks good to me, except for these minor style comments

::: js/ui/workspace.js
@@ +1167,3 @@
     Name: 'Workspace',
 
+    _init : function(metaWorkspace, monitorIndex, styleClass) {

Not a huge fan of passing down the styleClass here...I'd rather either have Workspace doing the check on its own by comparing monitorIndex to Main.layoutManager.primaryIndex or having the callers call workspace.actor.add_style_class_name()

::: js/ui/workspacesView.js
@@ +699,3 @@
                 let metaWorkspace = global.screen.get_workspace_by_index(w);
+                let workspace = new Workspace.Workspace(metaWorkspace, i,
+                                                        i != this._primaryIndex ? 'external-monitor' : null);

We already do a comparison between 'i' and 'this._primaryIndex' in other two places in the outer loop; I'd rather have a

let isPrimary = (i == this._primaryIndex);

at the beginning of the loop iteration and use that instead for clarity.
Comment 21 Giovanni Campagna 2013-01-18 19:59:31 UTC
Created attachment 233792 [details] [review]
Overview: apply extra padding to windows in external monitor

Add an style class targetting workspaces located outside the overview,
and use it for extra padding around the window clones. Padding is passed
down and applied inside LayoutStrategy, consolidating code that previously
handled the bottom side only.

With a better commit message too!
Comment 22 Cosimo Cecchi 2013-01-18 20:01:31 UTC
Review of attachment 233792 [details] [review]:

Yes!
Comment 23 Giovanni Campagna 2013-01-18 20:04:51 UTC
Attachment 231521 [details] pushed as c97b4dd - ViewSelector: use Params to pass optional parameters to addPage
Attachment 233792 [details] pushed as 27ad830 - Overview: apply extra padding to windows in external monitor