diff mbox series

[2/3] ui/cocoa: Resize window after toggling zoom-to-fit

Message ID 20240318-fixes-v1-2-34f1a849b0d9@daynix.com (mailing list archive)
State New, archived
Headers show
Series Fixes for "ui/cocoa: Let the platform toggle fullscreen" | expand

Commit Message

Akihiko Odaki March 18, 2024, 7:53 a.m. UTC
Resize the window so that the content will fit without zooming.

Fixes: 91aa508d0274 ("ui/cocoa: Let the platform toggle fullscreen")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 ui/cocoa.m | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Maydell March 22, 2024, 12:23 p.m. UTC | #1
On Mon, 18 Mar 2024 at 07:53, Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
>
> Resize the window so that the content will fit without zooming.
>
> Fixes: 91aa508d0274 ("ui/cocoa: Let the platform toggle fullscreen")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
>  ui/cocoa.m | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/ui/cocoa.m b/ui/cocoa.m
> index d6a5b462f78b..1324be6d32fe 100644
> --- a/ui/cocoa.m
> +++ b/ui/cocoa.m
> @@ -1378,6 +1378,7 @@ - (void)zoomToFit:(id) sender
>
>      [[cocoaView window] setStyleMask:styleMask];
>      [sender setState:styleMask & NSWindowStyleMaskResizable ? NSControlStateValueOn : NSControlStateValueOff];
> +    [cocoaView resizeWindow];
>  }
>
>  - (void)toggleZoomInterpolation:(id) sender
>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox series

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index d6a5b462f78b..1324be6d32fe 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1378,6 +1378,7 @@  - (void)zoomToFit:(id) sender
 
     [[cocoaView window] setStyleMask:styleMask];
     [sender setState:styleMask & NSWindowStyleMaskResizable ? NSControlStateValueOn : NSControlStateValueOff];
+    [cocoaView resizeWindow];
 }
 
 - (void)toggleZoomInterpolation:(id) sender