[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: fix possible race issue in ExpandGridView

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Sep 14 09:33:21 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
d2582ac5 by Prince Gupta at 2024-09-14T09:11:51+00:00
qml: fix possible race issue in ExpandGridView

- - - - -
b95e5673 by Prince Gupta at 2024-09-14T09:11:51+00:00
qml: fix view change handling with size changes in ExpandGridView

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/ExpandGridView.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -178,7 +178,10 @@ FocusScope {
             flickable.layout(true)
     }
 
-    onHeightChanged: _anchoredLayout(false)
+    // view needs to be relayout, since items may move
+    onWidthChanged: Qt.callLater(_anchoredLayout, true)
+    onHeightChanged: Qt.callLater(_anchoredLayout, true)
+
     onContentWidthChanged: _anchoredLayout(true)
     onContentHeightChanged: _anchoredLayout(true)
 
@@ -356,8 +359,11 @@ FocusScope {
 
     // layouts such that views indexes are preserved during a resize
     function _anchoredLayout(forceLayout) {
-        if (_currentRange[0] === _currentRange[1])
+        if (_currentRange[0] === _currentRange[1]) {
+            // empty view, we may still need to update internal variables here
+            flickable.layout(forceLayout)
             return
+        }
 
         // anchoring and expand item animation conflicts
         // causing view range oscilate on two different values



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/16b31aa57e3919dbe661c213868dee4b8bc1e3bd...b95e5673f4dd92fddb260dbe8f111eda7910214c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/16b31aa57e3919dbe661c213868dee4b8bc1e3bd...b95e5673f4dd92fddb260dbe8f111eda7910214c
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list