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 620940 - [linearView] Update workspace opacity
[linearView] Update workspace opacity
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Owen Taylor
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-08 09:22 UTC by Florian Müllner
Modified: 2010-06-16 19:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[linearView] Update workspace opacity (1.34 KB, patch)
2010-06-08 09:22 UTC, Florian Müllner
reviewed Details | Review
[linearView] Update workspace opacity (2.09 KB, patch)
2010-06-11 14:19 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2010-06-08 09:22:22 UTC
See patch.
Comment 1 Florian Müllner 2010-06-08 09:22:25 UTC
Created attachment 163030 [details] [review]
[linearView] Update workspace opacity

While zoomed out in drag mode, the workspaces at the left and right
of the active workspace are slightly transparent - when switching
workspaces, one of the transparent workspaces becomes the new active
workspace, but its opacity is not updated.
Comment 2 Owen Taylor 2010-06-08 19:09:37 UTC
Review of attachment 163030 [details] [review]:

Generally confused by the existing code...

_updateWorkspaceActors will have done workspace.actor.opacity = workspace.opacity, so it appears that workspace.opacity has gotten out of sync with the opacity that the workspace "should have" - and it doesn't seem right to me to set workspace.actor.opacity  workspace.opacity then correct it back to what it "should have".... workspace.opacity should be the "should have value", and indeed computeWorkspacePosition has 'workspace.opacity = (this._inDrag && w != active) ? 200 : 255' - so being the active workspace during a drag seems to be expected to be accounted for in workspace.opacity.

The manual update of workspace.actor.opacity without changing workspace.opacity in handleDragOver() looks suspicious to me.
Comment 3 Florian Müllner 2010-06-11 14:19:42 UTC
Created attachment 163390 [details] [review]
[linearView] Update workspace opacity

(In reply to comment #2)
> [...] indeed computeWorkspacePosition has 'workspace.opacity = (this._inDrag && w
> != active) ? 200 : 255' - so being the active workspace during a drag seems to
> be expected to be accounted for in workspace.opacity.

Kind of - computeWorkspacePosition() is not called on workspace switches. This patch changes that, though I'm not too happy to do a bunch of unnecessary calculations (workspace position relative to each other) in order to update a single property. Well, I guess we are doing more expensive stuff elsewhere ...


> The manual update of workspace.actor.opacity without changing workspace.opacity
> in handleDragOver() looks suspicious to me.

Fixed. As handleDragOver() is going away with the patches in bug 620504 with the replacement doing the same, there is now a dependency on said bug ...
Comment 4 Owen Taylor 2010-06-16 18:25:39 UTC
(In reply to comment #3)
> Created an attachment (id=163390) [details] [review]
> [linearView] Update workspace opacity
> 
> (In reply to comment #2)
> > [...] indeed computeWorkspacePosition has 'workspace.opacity = (this._inDrag && w
> > != active) ? 200 : 255' - so being the active workspace during a drag seems to
> > be expected to be accounted for in workspace.opacity.
> 
> Kind of - computeWorkspacePosition() is not called on workspace switches. This
> patch changes that, though I'm not too happy to do a bunch of unnecessary
> calculations (workspace position relative to each other) in order to update a
> single property. Well, I guess we are doing more expensive stuff elsewhere ...

I wasn't saying that you needed to computeWorkspacePosition() on workspaces switches, but rather that things had to be updated *as if* it had been called; that is, that workspace.opacity should always reflect the desired opacity of the workspace.

On the other hand, computeWorkspacePositions() doesn't seem to be doing anything genuinely expensive, and it's certainly simplest to keep the logic in one place, as this patch does.
Comment 5 Owen Taylor 2010-06-16 18:28:51 UTC
Review of attachment 163390 [details] [review]:

Very simple. Simple is good. Also seems to work right for me in testing.
Comment 6 Florian Müllner 2010-06-16 19:08:15 UTC
Attachment 163390 [details] got pushed as d8f7629a4 ...