Undecorated Window

Hello Defold Community,

Is there a way to have an undecorated (borderless) non-fullscreen window on desktop environments? I have searched the API and also come across DefOS, but I did not see a way of doing it with that library.

Thank you.

Hmm, I would have thought that DefOS had this feature… :thinking: Maybe there is a feature request? If not, perhaps you could create one?

@morikosm welcome to the community!

Do you mean something like this? :sweat_smile:

If so, I will create a PR that adds this functionality (need to refactor it first + I have only Windows implementation for now)

6 Likes

@Pawel , yes that is exactly what I’d like, as I’d like my game to load up with an undecorated window and to manage the window size from within the game options. If you would be so kind as to make a PR, it would be greatly appreciated.

4 Likes
5 Likes

Implementation (Windows only) is here:

I also created a PR for @Pkeod’s defos main repo:

For HTML5 - I don’t think it even makes any sense? There is no border, caption to hide.

For Linux - I believe X11 could be used to modify window property. Some usage of XChangeProperty.

For Mac - I don’t know, but googled up “Cocoa”. I don’t have any apple device though to test even.

1 Like

Some searching online implies it should be as easy as:

glfwSetWindowAttrib(handle, GLFW_DECORATED, GLFW_FALSE);

Though there isn’t a way to get a GLFW window handle or access this function with just the public dmSDK.

https://www.glfw.org/docs/3.3/window_guide.html#window_hints_wnd

1 Like

The lack of a public dmSDK function for this was also an issue when I investigated how to make a game like Rusty’s Retirement. It requires: borderless window, window always on top, and transparent window areas where mouse clicks fall through.

If the dmSDK API were to be opened up so that you can configure how the window and graphics context are created, it would be nice to have it provide enough access so that you could do all the above.

1 Like

We’ve mostly been waiting for our upgrade to glfw3. We only have Linux left, then we can start looking at using glfw’s own functions for this.

3 Likes