From 0b6f693636c8d54bdc8768cb0eb8a9539d2a00f3 Mon Sep 17 00:00:00 2001 From: Bastiaan van der Plaat Date: Thu, 8 May 2025 09:20:26 +0200 Subject: [PATCH] UI/AppKit: Use webview layout event instead of window resize events Currently the window resize events are used to resize the webview. But when extra window items appear, for example: search or DevTools Bar then the webview is clipped out of the window. This also happens when the tab bar is opened and closed. Listening to layout events resolves these clipping issues completely. --- UI/AppKit/Interface/LadybirdWebView.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/AppKit/Interface/LadybirdWebView.mm b/UI/AppKit/Interface/LadybirdWebView.mm index 9cb31824de9..139e64fb896 100644 --- a/UI/AppKit/Interface/LadybirdWebView.mm +++ b/UI/AppKit/Interface/LadybirdWebView.mm @@ -1550,9 +1550,9 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_ [self setWindowSize:window.size()]; } -- (void)viewDidEndLiveResize +- (void)layout { - [super viewDidEndLiveResize]; + [super layout]; [self handleResize]; }