IDE: don't call resize(0, 0) on completion widget#7036
Conversation
In case you haven't checked, quoting https://doc.qt.io/qt-6/qwidget.html#size-prop
Just tested 3.14-rc1 on fedora w/ wayland and couldn't trigger a crash, but found some weird behavior of the autocompletion box after moving the SC window across two screens I found that when placing the window to a position where the autocomplete box couldn't spawn (due to limited space), it simply wouldn't spawn. BTW - since bruno is using sway - maybe this is more a problem of sway? Is the compositor having something in its logs? edit2: Found some more bugs when closing the IDE. I think wayland is not really stable yet b/c I never had such problems when using x11. |
|
Thanks for testing!
I didn't think to check that, sorry. Thanks for the reference! So when does this function actually triggers closing the widget? I didn't catch the difference in behavior in this PR.
Did you test with a secondary display? |
Yes, but gnome and not sway. |
|
I was on this as well, and I came to the same conclusion :D
I don't think resize(0,0) is meant to make the widget disappear: it should make it shrink to the minimum size constraints of its children. Quoting the same doc page above:
(I actually tested this on a small reproducer, if the child has a positive size, the parent doesn't resize to 0). Maybe we should replace it with adjustSize()? A strange thing I noticed: with resize(0,0) in place, during (I'm testing on sway, but I don't have a second monitor, so I tested on a virtual one. I think it should be equivalent, but I'm not 100% sure.) EDIT: @capital-G, I've tried on sway the situations you describe on gnome, and I couldn't make them happen. When there is not enough space, the autocompletion moves so that it can be displayed. |
|
|
||
| void CompletionMenu::adapt() { | ||
| mListView->setFixedWidth(mListView->sizeHintForColumn(0)); | ||
| resize(0, 0); |
There was a problem hiding this comment.
maybe substitute resize(0,0) with adjustSize()? Not fundamental though: it doesn't make a difference now because adapt()is currently called only before the widget is shown for the first time
There was a problem hiding this comment.
@elgiano do you think we should risk adding this for 3.14.0-rc2 ? From the discussion so far it seems that the original bug only applies to a very specific environment configuration, is hard to reproduce, and I don't have full grasp of what's actually being changed by either removing the resize or changing it to adjustSize.
|
After testing the version with |


Purpose and Motivation
Fixes #7007, according to a user report.
But... what does it break instead?
This is a somewhat blind attempt at fixing a crash on Wayland with multiple displays (see #7007 for bug description).
I don't know what was the purpose of
resize(0, 0)in the first place though. For reference it was introduced in 7f2db98 as part of #1333. On the surface the autocomplete hints still show as they have before this PR, as far as I can tell...I'd appreciate if others could test to make sure this doesn't break any functionality!
Types of changes
To-do list