Removing the TitleBar and fixing window size using GLFW

Hi there,
Im using GLFW and Im trying to make an osx app with no titlebar, also with a fixed 200,200 window size, that ideally can’t be resized.
Could someone tell me if these things are possible and if you’d be so kind, point me in the direction of some solutions. :smile:
Many many thanks,
Miles

Hey Miles, go into ofAppGLFWWindow.cpp, and add the following line where the other glfwWindowHints are set:

glfwWindowHint(GLFW_DECORATED, false);

This will deactivate all chrome for your oF window, and and therefore you’ll end up without titlebar and no way to resize it. You’ll also not be able to move the window, unless you change the window position from within ofApp.cpp using ofSetWindowPostion() =)

Note that this will change the behaviour of all your oF Apps. If you want to compile your app and send it to someone, and then change it back for your other oF apps, you should be golden.

Good luck!

Worked a charm!
thank you very much

Hi there, thanks again for this.
Turns out not being able to move the window around is a bit of a pain, is there a way of having the titlebar, but no resizing?
Cheers,
Miles

But of course there is =) although it is a bit more involved, and unfortunately i don’t have time atm to get into more details, feel free to use this gist for your ofGLFWWindow.cpp…

If you comment out the w_borderless_resizable scope starting with line 166, you should get what you’re after =)

thanks for this,
Ive tried replacing the code in ofglfwwindow.cpp with the gist, then uncommented the resizable scope, but it hasn’t had the desired effect, i suspect I’ve done something wrong here…

Using this ofGLFWWindow.cpp, try grabbing the window near where you’d expect the title bar to be - it should act as if there was an invisible titlebar, which you can use to move the window around.

Does that work?

i just get the default window when i replace the code in ofGLFWWindow.cpp with the code in the gist that you shared in your previous reply.