Merge lp:~aacid/unity-2d/unity-2d_fix_starting_size_problem into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 932
Merged at revision: 942
Proposed branch: lp:~aacid/unity-2d/unity-2d_fix_starting_size_problem
Merge into: lp:unity-2d
Diff against target: 22 lines (+12/-0)
1 file modified
shell/app/shelldeclarativeview.cpp (+12/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_fix_starting_size_problem
Reviewer Review Type Date Requested Status
Gerry Boland (community) Needs Fixing
Michał Sawicz Pending
Florian Boucault Pending
Review via email: mp+94007@code.launchpad.net

Description of the change

Make sure the size is the size the QML root elements wants to have

This should always be true since we use SizeViewToRootObject resizeMode but seems that there is some bug somewhere that makes the wrong size be set to the view

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Still happening for me :(

review: Needs Fixing
930. By Albert Astals Cid

More expeditive way to make sure our size is not wrongly set

931. By Albert Astals Cid

fix comment

Revision history for this message
Albert Astals Cid (aacid) wrote :

Michał: Florian: Gerry wants your opinion on this, the fix is "not nice" but I could not find any other way to fix it

932. By Albert Astals Cid

Add FIXME

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/app/shelldeclarativeview.cpp'
2--- shell/app/shelldeclarativeview.cpp 2012-02-28 08:00:04 +0000
3+++ shell/app/shelldeclarativeview.cpp 2012-02-28 10:18:19 +0000
4@@ -155,6 +155,18 @@
5 void
6 ShellDeclarativeView::resizeEvent(QResizeEvent *event)
7 {
8+ if (rootObject()) {
9+ const int wantedWidth = rootObject()->property("width").toInt();
10+ const int wantedHeight = rootObject()->property("height").toInt();
11+ if (width() != wantedWidth || height() != wantedHeight) {
12+ // FIXME This should never happen as we are using SizeViewToRootObject
13+ // in our QDeclarativeView but it seems it happens sometimes
14+ // that we get a size it's not the size the QML wants
15+ // so force it to the size we want in those cases
16+ // This is just a workaround for the time being
17+ resize(wantedWidth, wantedHeight);
18+ }
19+ }
20 updateShellPosition();
21 Unity2DDeclarativeView::resizeEvent(event);
22 }

Subscribers

People subscribed via source and target branches