Ladybird: Explicitly handle setting the AppKit web view's first viewport

We were relying on TabController setting the web view's initial viewport
in [TabController windowDidResize], which has been triggered when the
Tab is first created. However, it turns out that only happens due to the
toolbar being added to the Tab window, causing a resize event. When the
web view is embedded in a window without a toolbar, this resize event is
not triggered. Therefore, we must set the viewport ourselves when the
web view is added to a window.
This commit is contained in:
Timothy Flynn 2023-08-29 09:03:02 -04:00 committed by Andrew Kaster
parent b9b2274078
commit 1ffe0d3590
Notes: sideshowbarker 2024-07-16 18:03:21 +09:00

View file

@ -907,6 +907,12 @@ static void copy_text_to_clipboard(StringView text)
[super drawRect:rect];
}
- (void)viewDidMoveToWindow
{
[super viewDidMoveToWindow];
[self handleResize];
}
- (void)viewDidEndLiveResize
{
[super viewDidEndLiveResize];