Fix: PopupResizeHandler work area size calculation #13477
+9
−4
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.
While analyzing issue #13469 and #12972 (menu shrinking unexpectedly), I noticed a subtle
calculation issue in
PopupResizeHandler._on_actor_show()that could contributeto sizing problems under certain conditions.
The previous code compared the outer actor size against the work area but then
adjusted the inner content size. This works correctly most of the time, but can
lead to incorrect results when there's padding between the actor and its content
(e.g., from theme CSS) and timing issues occur during layout.
This fix explicitly calculates the padding offset between the outer actor and
inner content, then uses it to determine the correct maximum content size that
fits within the work area.
This is admittedly an edge case, but it becomes more relevant with UI scaling.
For example, on a 1366×768 laptop with 150% scaling and the menu resized to
maximum (900px logical = 1350px physical + ~30px padding = 1380px), the menu
actor exceeds the work area (1366px), triggering this code path with potentially
incorrect calculations.
Changes
Tested
Related