Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX - Disable Fullscreen Mode from the zoom button?

I'm looking for either a setting option of NSWindow in XIB editor or via programmatically take I can disable the fullscreen mode feature in OS X when the user clicks the zoom button (green traffic light), as it does not work well with my UI design. (Instead, use it for normal window zooming.)

Anyone can give me some hints where to look for?

like image 239
Cai Avatar asked Oct 31 '15 21:10

Cai


People also ask

Can I disable fullscreen on Mac?

While using any application in full-screen mode, move your pointer to the upper-left corner of your screen. This will activate macOS' commands for controlling open windows. Click on the green button to exit full screen. If you like to use keyboard shortcuts, you can press Command + Control + F.

How do I stop my Mac from zooming in and out?

To turn off Zoom, check the Off radio button in the Zoom section of the Universal Access system preferences or by pressing Option + Command + 8. Note: The scroll-wheel modifier specified in the Zoom options will continue to function even if Zoom is turned off.

How do I get rid of zoomed screen on Mac?

To zoom out, press these three keys together: Option, Command, and Minus sign (-).


1 Answers

For SwiftUI:

.onReceive(
    NotificationCenter.default.publisher(
        for: NSApplication.willUpdateNotification), perform: { _ in
            for window in NSApplication.shared.windows {
                window.collectionBehavior = .fullScreenAuxiliary
            }
})
like image 108
fankibiber Avatar answered Oct 15 '22 08:10

fankibiber