Merge lp:~aacid/unity-2d/unity-2d-shell_limit_shell_width into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Albert Astals Cid
Status: Merged
Approved by: Florian Boucault
Approved revision: 1005
Merged at revision: 1006
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell_limit_shell_width
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 14 lines (+4/-1)
1 file modified
shell/Shell.qml (+4/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell_limit_shell_width
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email:

Description of the change

Do not try to be wider than the total screen geometry

Happens sometimes on startup when the enabled and availableGeometry are still in flux and it might end up meaning a badly sized shell view

To post a comment you must log in.
1005. By Albert Astals Cid

Add comment as to why the min is needed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/Shell.qml'
2--- shell/Shell.qml 2012-02-10 16:39:03 +0000
3+++ shell/Shell.qml 2012-02-10 17:01:29 +0000
4@@ -27,7 +27,10 @@
5 we want the shell to take all the available space, including the one we
6 reserved ourselves via strutManager. */
7 height: declarativeView.screen.availableGeometry.height
8- width: declarativeView.screen.availableGeometry.width + (strutManager.enabled ? strutManager.width : 0)
9+ // We need the min because X is async thus it can happen that even if strutManager.enabled is true
10+ // declarativeView.screen.availableGeometry.width still has not been updated and thus the sum might be bigger than declarativeView.screen.geometry.width.
11+ // The real nice and proper solution would be strutManager having a hasTheChangeBeenApplied property
12+ width: Math.min(declarativeView.screen.geometry.width, declarativeView.screen.availableGeometry.width + (strutManager.enabled ? strutManager.width : 0))
14 "shell"


People subscribed via source and target branches