Repository navigation
Conversation
[Medium impact] The change reaches drag-picture preparation across Folio's list, column, and grid views. The PR appears safe to merge, with a non-blocking request to cover delegate destruction in the tests. Findings
SummaryThis PR moves hover-generated drag pictures into a C++ helper that keeps pending captures alive when rows or tiles disappear.
One non-blocking test gap remains: deleting the helper while its window stays open is not covered. Reviews (1) · Last reviewed commit: "Retain pending grabs through completion ..." · Reviewed by Greptile |
| QVERIFY(picture->capture(source)); | ||
| if (i % 2 == 0) { | ||
| delete source; | ||
| // A rendered frame is the boundary for the pending grab. | ||
| QSignalSpy frame(window, &QQuickWindow::frameSwapped); | ||
| window->update(); | ||
| QTRY_VERIFY(!frame.isEmpty()); | ||
| QCOMPARE(ready.count(), 0); |
There was a problem hiding this comment.
Delegate destruction goes untested. The source-deletion branch leaves
picture alive, so its m_grab still holds the pending capture. The other branch deletes the whole window. Neither covers scrolling a delegate away, where both the source and DragPicture disappear while the window keeps rendering—the case that needs the new window-held reference.
Add a branch that deletes both objects after capture(), leaves the window open, and waits for another frame. This would cover the ownership path this fix adds.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Rapid PageDown/PageUp scrolling with the pointer over a row can crash Folio while Qt is preparing its drag picture. Reproduced on unmodified main at
905999e, without #122 applied.A small public-Qt helper preserves the existing hover-generated pictures in lists, columns and the grid. Superseded requests can finish safely; discarded delegates receive no reply. No new dependencies.
Related to #122 because both touch the row's drag-picture handling. This PR is based directly on main and can be reviewed independently. If #122 lands first, I'll adapt this fix to it and rerun the relevant checks.
Evidence
QQuickItemGrabResult::render().After: Six fresh processes completed all 2,160 keypresses and closed normally; an additional process completed 1,080 keypresses and closed normally.
bin/test -V: 253 passed, 0 failed, 1 environmental skip (root-drive trash requires writable/without.Trash).Merge Danger
Door: Two-way — code-only change, no data migration.
Blast Radius: Drag pictures — shared by list, column and grid delegates.