Skip to content

Instantly share code, notes, and snippets.

@LRFLEW
Created March 12, 2016 23:30
Show Gist options
  • Save LRFLEW/5f30731b9863c99f13e4 to your computer and use it in GitHub Desktop.
Save LRFLEW/5f30731b9863c99f13e4 to your computer and use it in GitHub Desktop.
How to prevent Fullscreen button on OS X Title Bar
@import AppKit;
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
void update_SDL_Window_NSWindow(SDL_Window *win) {
SDL_SysWMinfo wmi;
SDL_VERSION(&wmi.version);
if (SDL_GetWindowWMInfo(win, &wmi)) {
switch (wmi.subsystem) {
case SDL_SYSWM_COCOA:
wmi.info.cocoa.window.collectionBehavior = NSWindowCollectionBehaviorFullScreenAuxiliary;
break;
default: ;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment