Feature request - disabling window borders

rickard_s wrote on Monday, November 19, 2007:

Yes, as the subject says.

I am currently working on an application using both GLFW and the (also very clean and portable) guisystem FLTK for my gameobject-editor.
Unfortunately, closing the GLFW-window will kill everything, so I want to disable the windowborder and use some GLFW-gadgets instead,
hooking it beside the GLFW displayarea by throwing around some coordinate variables. =)

Is this possible in the near future?
Can someone help me with a workaround for this somehow until it is implemented?

(btw, if someone happens to have fltk experience, I KNOW there is openglsupport in it,
but it uses glut… ;( )

elmindreda wrote on Tuesday, November 20, 2007:

If you wish to prevent the GLFW window from closing, set a window close callback. §3.2.4 of the reference manual.

rickard_s wrote on Wednesday, November 21, 2007:

ah… great!
That will solve the main problem.

Will my feature request be relevant enough for inclusion in the future?
I have a function declaration ready: glfwSetWindowBorder(bool state);
Now just the function needs an implementation… =P

Anyway, looking forward to any glfw updates!
thanks.

/R

elmindreda wrote on Wednesday, November 21, 2007:

If you make an application without window borders, your users will hate you. Why would you want that?

rickard_s wrote on Wednesday, November 21, 2007:

Heh, well, I am the only user that is going to use it. =)=)
It’s for my own gameframework. =)

But… it will have window borders, but not system-borders.
I will make my own borders using fltk to integrate it into the look of my application gui.

Oh, and also, would it be possible to make glfw to not show the application in the taskbar?
I just want one button in the taskbar… I’m trying to figure out the same thing for fltk.

elmindreda wrote on Thursday, November 22, 2007:

It’s possible that GLFW 3.0 will support borderless windows, in order to accomodate splash screens, etc., as other people have been requesting such a feature.

fabriziovilla wrote on Saturday, December 08, 2007:

I am interested in this feature. It might be useful to create something similar to xmms / winamp with custom buttons to close the window.

elmindreda wrote on Saturday, December 08, 2007:

A 2D API like Quartz, Cairo or WPF would probably be a better fit that OpenGL for such an application. Nevertheless, yes, it would be possible.

fabriziovilla wrote on Saturday, December 08, 2007:

Thanks, but I am interested in APIs/frameworks that are cross-platform.

kohaistyle wrote on Sunday, January 27, 2008:

Hi all !

For those wanting to remove window border, it’s quite an easy task under win32 ( yeah i needed that for a VJ thing i’m trying to make )

So here’s a little nifty function :

void glfwSetBorder(HWND window, int on)
{
RECT rect;
DWORD style;

if\(window == NULL\)
	window = FindWindow\( "GLFW", NULL\);

style = GetWindowLong(window, GWL_STYLE);

if (on)
{
if (!GetWindowRect(window, &rect)) return;
//if (!GetClientRect(window, &rect)) return;

style &= ~WS\_OVERLAPPEDWINDOW;
style |= WS\_POPUP;
   AdjustWindowRect \(&rect, style, TRUE\);
// & ~WS\_CAPTION
   SetWindowLong\(window, GWL\_STYLE, style \);
 \}

else
{
if (!GetWindowRect(window, &rect)) return;

   style |= WS\_CAPTION;	
style |= WS\_OVERLAPPEDWINDOW;
style &= ~WS\_POPUP;

   AdjustWindowRect \(&rect, style, TRUE\);

   SetWindowLong\(window, GWL\_STYLE, style\);
 \}

SetWindowPos\(window, HWND\_TOPMOST,
            rect.left, rect.top,
            rect.right - rect.left, rect.bottom - rect.top,
            SWP\_NOMOVE | SWP\_FRAMECHANGED\);

}

Simply call : glfwSetBorder( NULL, 1); ( 0 to re-enabled the borders )

Hope that helps !

kohaistyle wrote on Sunday, January 27, 2008:

Oops, forgot to say that you need to put:

#include <windows.h>

somewhere in your code, of course ! :slight_smile:

jleslie48 wrote on Friday, January 27, 2012:

OK, I built this into the project but it has no effect. any way to do this?

jleslie48 wrote on Friday, January 27, 2012:

In order to get the sample code to build I had to change Findwindow call by
adding a typecast. My guess this is not working:

if(window == NULL)
window = FindWindow( (LPCWSTR)“GLFW”, NULL); //JL:: added (lpwstr) I
think its wrong)

any ideas?