GLFW_DECORATED not working on MacOS

Setting GLFW_DECORATED to false doesn’t seem to work on MacOS. The menubar still appears at the top of the application. However, when I run the same code on Windows it correctly removes the title bar. What am I doing wrong?

This is the code:

	glfwWindowHint(GLFW_RED_BITS, 8);
	glfwWindowHint(GLFW_GREEN_BITS, 8);
	glfwWindowHint(GLFW_BLUE_BITS, 8);
	glfwWindowHint(GLFW_ALPHA_BITS, 0);
	glfwWindowHint(GLFW_DEPTH_BITS, 32);
	glfwWindowHint(GLFW_STENCIL_BITS, 8);
	glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
	if (g_settings.GetSetting(Settings::settingAntiAliasing))
	{
		glfwWindowHint(GLFW_SAMPLES, 4);
	}
	else
	{
		glfwWindowHint(GLFW_SAMPLES, 0);
	}
	if (g_windowMode == modeWindowedFullScreen)
	{
		glfwWindowHint(GLFW_DECORATED, GL_FALSE);
	}
	if (g_sRGB)
	{
		glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE);
	}
	g_pWindow = glfwCreateWindow(g_screenWidth, g_screenHeight, "App", NULL, NULL);

thanks for any help you can give me with this

Welcome to the GLFW forums!

glfwWindowHint(GLFW_DECORATED, GL_FALSE); should work on MacOS. Which version of GLFW are you using? I would check removing the if statement to ensure your application is setting the hint to false.

There is a test called windows.c which you can build from the glfw source using cmake. Pressing the D key when this test is running should switch the four windows from being decorated to non-decorated. If you are able to check that it would help. This uses a different approach, setting the attribute after window creation, but it should work.

that line definitely being called - I checked. The version is 3.3. I will try the test later

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.