fix(windows): show split tooltip before move #5230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe #5189 is a Windows only bug. This PR fixes tooltips of splits appearing in the wrong position [after the first hover(?)] on Windows. The issue might also occur when a streamer goes offline and the thumbnail isn't shown, but I didn't test that.
While debugging, I noticed that even though we call
adjustSize
which, according to the documentation, adjusts the area its children occupy, the tooltip still has a larger size than expected. It's only adjusted when callingshow()
(if you want to reproduce this, try placing logpoints inQLayoutPrivate::doResize
,QWidget::setGeometry
, andQWidgetPrivate::setGeometry_sys
).For non-Windows platforms, nothing changes.
On Windows, the tooltip is now shown before it's moved. This is fine on Windows, as the new window doesn't become visible right after calling
show()
(only after processing some more events). Since a lot of the resizing/activating happens inshow()
, the window has the correct size afterward, andmoveTo
-ing it will place it at the desired position.I don't know why we don't need to do this for the tooltips in
ChannelView
.Fixes #5189. @8thony could you test the change? Make sure you place the window on some side of your screen.
I have a fix for the bug I mentioned in #5189 (comment) (it's one line), but I suppose it's better to do that separately.