[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 4/6] ui/cocoa: Make window resizable
From: |
Akihiko Odaki |
Subject: |
[PATCH v10 4/6] ui/cocoa: Make window resizable |
Date: |
Wed, 14 Feb 2024 13:32:04 +0900 |
The window will be resizable when zoom-to-fit is on.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
ui/cocoa.m | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 518fae26f6f4..a1f54b3ebb9a 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1378,8 +1378,10 @@ - (void)zoomToFit:(id) sender
{
stretch_video = !stretch_video;
if (stretch_video == true) {
+ [normalWindow setStyleMask:[normalWindow styleMask] |
NSWindowStyleMaskResizable];
[sender setState: NSControlStateValueOn];
} else {
+ [normalWindow setStyleMask:[normalWindow styleMask] &
~NSWindowStyleMaskResizable];
[cocoaView resizeWindow];
[sender setState: NSControlStateValueOff];
}
@@ -2032,6 +2034,7 @@ static void cocoa_display_init(DisplayState *ds,
DisplayOptions *opts)
if (opts->u.cocoa.has_zoom_to_fit && opts->u.cocoa.zoom_to_fit) {
stretch_video = true;
+ [normalWindow setStyleMask:[normalWindow styleMask] |
NSWindowStyleMaskResizable];
}
create_initial_menus();
--
2.43.0
- [PATCH v10 0/6] ui/cocoa: Use NSWindow's ability to resize, Akihiko Odaki, 2024/02/13
- [PATCH v10 1/6] ui/cocoa: Release specific mouse buttons, Akihiko Odaki, 2024/02/13
- [PATCH v10 2/6] ui/cocoa: Scale with NSView instead of Core Graphics, Akihiko Odaki, 2024/02/13
- [PATCH v10 3/6] ui/cocoa: Let the platform toggle fullscreen, Akihiko Odaki, 2024/02/13
- [PATCH v10 4/6] ui/cocoa: Make window resizable,
Akihiko Odaki <=
- [PATCH v10 5/6] ui/cocoa: Call console_select() with the BQL, Akihiko Odaki, 2024/02/13
- [PATCH v10 6/6] ui/cocoa: Remove stretch_video flag, Akihiko Odaki, 2024/02/13