I cannot get the GLFW_DECORATED flag to work on MacOS. I tried using glfwWindowHint(GLFW_DECORATED, GL_FALSE);
also
glfwSetWindowAttrib(g_pWindow, GLFW_DECORATED, false);
even the native method:
NSWindow* nsWindow = glfwGetCocoaWindow(g_pWindow);
[nsWindow setStyleMask:NSBorderlessWindowMask];
the title bar always appears, no matter what I do.
I tried creating a barebones Xcode project with GLFW linked, to verify that it wasn’t something weird with my project, but still had the same problem.
I would appreciate any help you can give me to fix this
cheers
Ed
GLFW doesn’t have a way to hide the MacOS menu bar, but I think the Cocoa function [NSMenu setMenuBarVisible:NO]; should work, though this may have other side-effects.
With GLFW the main way to make a window without the menu is to go fullscreen.
This my repo where I implemented the attrib: GLFW_TITLEBAR, you can only set it after the window is created for now.
Look at the file:
cocoa_window.m on line 1290 for the implementation.
Also I have an imgui repo for an example,this also downloads the glfw repo. Here you can see what enabling and disabling flags do. But basically: GLFW_TITLEBAR makes the titlebar invissible, thats why dragging still works. If you disable the tible bar and the GLFW_DECORATIONS, your titlebar is gone and the buttons. But you can’t drag anymore.
Im planning on implementing functionallity to manually turning on and of the CLOSE/MINIMIZE/MAXIMIZE buttons.