mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
The upgrade to egui 0.34.0 in #44053 replaced the usage of the deprecated `Ui::available_rect` method with `Ui::content_rect` as suggested in the deprecation notice in egui. However, `content_rect` is not equivalent to `available_rect` and doesn't seem to account for the area occupied by the egui panels. Since `content_rect` returns the window's inner dimensions, we don't ask the webview to resize itself to the correct dimension that excludes the toolbar (tabs and url). We also pass the correct dimension to egui's paint callback, which meant that the WebView appeared vertically squashed. Fix this by using `available_rect_before_wrap` method instead of `content_rect`. This seems to return the correct area that we need for the WebView's dimenstion. The code in egui also seems closer to what we want as it relies on a cursor that is advanced after each widget is added. However, I'm not sure in which scenario the wrapping matters as there is no documentation for this method. Testing: Tested manually as we don't have automated tests for the shell. Fixes: #44136 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>