[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v11 4/6] ui/cocoa: Make window resizable
From: |
Akihiko Odaki |
Subject: |
[PATCH v11 4/6] ui/cocoa: Make window resizable |
Date: |
Sat, 17 Feb 2024 20:18:50 +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 0ebe0f326373..17f290987563 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1379,8 +1379,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];
}
@@ -2033,6 +2035,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.1
- [PATCH v11 0/6] ui/cocoa: Use NSWindow's ability to resize, Akihiko Odaki, 2024/02/17
- [PATCH v11 1/6] ui/cocoa: Release specific mouse buttons, Akihiko Odaki, 2024/02/17
- [PATCH v11 2/6] ui/cocoa: Scale with NSView instead of Core Graphics, Akihiko Odaki, 2024/02/17
- [PATCH v11 3/6] ui/cocoa: Let the platform toggle fullscreen, Akihiko Odaki, 2024/02/17
- [PATCH v11 4/6] ui/cocoa: Make window resizable,
Akihiko Odaki <=
- [PATCH v11 5/6] ui/cocoa: Call console_select() with the BQL, Akihiko Odaki, 2024/02/17
- [PATCH v11 6/6] ui/cocoa: Remove stretch_video flag, Akihiko Odaki, 2024/02/17