mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
UI/AppKit: Handle window resize events during live resizing
This lets us redraw the WebView while live resize events are ongoing. By doing so, we can also update the window rect from within the WebView, rather than requiring a separate method invocation (which the Inspector and Task Manager windows were missing).
This commit is contained in:
parent
3bbe1b0c62
commit
4ae1bca67d
Notes:
github-actions[bot]
2024-11-08 20:32:04 +00:00
Author: https://github.com/trflynn89
Commit: 4ae1bca67d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2235
Reviewed-by: https://github.com/awesomekling ✅
4 changed files with 6 additions and 12 deletions
|
@ -55,9 +55,7 @@
|
|||
|
||||
- (void)windowDidResize:(NSNotification*)notification
|
||||
{
|
||||
if (![[self window] inLiveResize]) {
|
||||
[[[self inspector] web_view] handleResize];
|
||||
}
|
||||
[[[self inspector] web_view] handleResize];
|
||||
}
|
||||
|
||||
- (void)windowDidChangeBackingProperties:(NSNotification*)notification
|
||||
|
|
|
@ -196,6 +196,9 @@ struct HideCursor {
|
|||
|
||||
- (void)handleResize
|
||||
{
|
||||
auto size = Ladybird::ns_size_to_gfx_size([[self window] frame].size);
|
||||
[self setWindowSize:size];
|
||||
|
||||
[self updateViewportRect];
|
||||
[self updateStatusLabelPosition];
|
||||
}
|
||||
|
|
|
@ -623,12 +623,7 @@ static NSString* const TOOLBAR_TAB_OVERVIEW_IDENTIFIER = @"ToolbarTabOverviewIde
|
|||
self.location_toolbar_item_width = [[[self.location_toolbar_item view] widthAnchor] constraintEqualToConstant:width];
|
||||
self.location_toolbar_item_width.active = YES;
|
||||
|
||||
if (![[self window] inLiveResize]) {
|
||||
[[[self tab] web_view] handleResize];
|
||||
}
|
||||
|
||||
auto size = Ladybird::ns_size_to_gfx_size([[self tab] frame].size);
|
||||
[[[self tab] web_view] setWindowSize:size];
|
||||
[[[self tab] web_view] handleResize];
|
||||
}
|
||||
|
||||
- (void)windowDidChangeBackingProperties:(NSNotification*)notification
|
||||
|
|
|
@ -54,9 +54,7 @@
|
|||
|
||||
- (void)windowDidResize:(NSNotification*)notification
|
||||
{
|
||||
if (![[self window] inLiveResize]) {
|
||||
[[[self taskManager] web_view] handleResize];
|
||||
}
|
||||
[[[self taskManager] web_view] handleResize];
|
||||
}
|
||||
|
||||
- (void)windowDidChangeBackingProperties:(NSNotification*)notification
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue