Bug 459284 - Every ScrollablePage implementation sends a binding loop error for its MouseArea
Summary: Every ScrollablePage implementation sends a binding loop error for its MouseArea
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: Master
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords: regression
: 458651 461152 467791 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-17 14:48 UTC by Nate Graham
Modified: 2023-04-03 23:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2022-09-17 14:48:35 UTC
Like so:

file:///home/nate/kde/usr/lib64/qml/org/kde/kirigami.2/ScrollablePage.qml:203:9: QML MouseArea: Binding loop detected for property "implicitHeight"
file:///home/nate/kde/usr/lib64/qml/org/kde/kirigami.2/ScrollablePage.qml:203:9: QML MouseArea: Binding loop detected for property "implicitHeight"

Can be reproduced by simply opening any Kirigami app that uses ScrollablePage anywhere.
Comment 1 Nate Graham 2022-09-17 14:54:19 UTC
This code looks suspicious:

height: Math.max(root.flickable.height, implicitHeight)
            implicitHeight: {
                let impl = 0;
                for (let i in itemsParent.visibleChildren) {
                    let child = itemsParent.visibleChildren[i];
                    if (child.implicitHeight <= 0) {
                        impl = Math.max(impl, child.height);
                    } else {
                        impl = Math.max(impl, child.implicitHeight);
                    }
                }
                return impl + itemsParent.anchors.topMargin + itemsParent.anchors.bottomMargin;
            }
Comment 2 Nate Graham 2022-10-31 23:52:27 UTC
*** Bug 458651 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2022-10-31 23:52:31 UTC
*** Bug 461152 has been marked as a duplicate of this bug. ***
Comment 4 Marco Martin 2022-11-07 09:10:58 UTC
propagating implicitheight from child to parent should be ok, I'm not sure why itdoes loops..

however, that code indeed is not pretty, is a bit of a acrobatics to make old code work, I think is one of the things when branching occurs i'm going to change making it better code, by allowing a single child as main content. (and knowingly break some apps in the process, but that is the only moment it can be done at all)
Comment 5 Bug Janitor Service 2022-11-07 10:20:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/819
Comment 6 Marco Martin 2022-11-15 12:51:58 UTC
Git commit b73f7b9d1fb7a08dd905616062ac67820fa8969e by Marco Martin.
Committed on 15/11/2022 at 12:51.
Pushed by mart into branch 'master'.

Fix binding loop

accessing implicitheight of a child from the parent causes a binding
loop, accessing he height seems to fix it

M  +1    -5    src/controls/ScrollablePage.qml

https://invent.kde.org/frameworks/kirigami/commit/b73f7b9d1fb7a08dd905616062ac67820fa8969e
Comment 7 Nate Graham 2022-11-24 01:17:23 UTC
The fix had to be reverted because it broke Info Center; re-opening.
Comment 8 Nate Graham 2023-04-03 23:14:08 UTC
*** Bug 467791 has been marked as a duplicate of this bug. ***