PDA

View Full Version : Window with borderless or decorations



nt
02-20-2008, 01:53 PM
Can any one explain how to open a glut window with out the window decorations (border less). I was reading the red book example double.c. Please help me

Dark Photon
02-20-2008, 02:37 PM
Can any one explain how to open a glut window with out the window decorations (border less).
The window decorations are a function of the window manager you're using. I don't think GLUT provides any abstract interface for tweaking this, however if you do glutFullScreen(), I think it disables the borders (at least for UNIX/Linux platforms).

If you want the no-borders magic for UNIX/Linux, let me know.

nt
02-20-2008, 02:49 PM
"If you want the no-borders magic for UNIX/Linux, let me know. "


yes I would like to know how to do it on Linux

thanks,
nt

nt
02-20-2008, 02:54 PM
glut full screen is good, but has not control over the position or size of the winodw, I have used x-windows and that had the ability to control all'

Dark Photon
02-20-2008, 09:21 PM
"If you want the no-borders magic for UNIX/Linux, let me know. " ...yes I would like to know how to do it on Linux
This works:
* 91717-window-without-title-bar.htm (http://fixunix.com/xwindows/91717-window-without-title-bar.html)

What I don't know is if glutGetWindow returns the X window ID or an internal GLUT window number. You can check the freeglut or openglut source (whichever you're using) to see.

Dark Photon
02-21-2008, 05:31 AM
glut full screen is good, but has not control over the position or size of the winodw, I have used x-windows and that had the ability to control all'
Yes, I agree and often do raw X/glX test progs. Once you whip one up, it's just copy-paste-modify. GLUT is for very simple test programs and tutorials.

Sounds like you've got one, but if you want source for a short X/glX test prog that gives you position/size/no-window-decorations control w/o fullscreen, just PM me (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=sendprivate&User=14546) with your e-mail address.

But just to be clear, GLUT provides the ability to set the window size and position (glutInitWindowPosition, glutInitWindowSize (http://www.opengl.org/documentation/specs/glut/spec3/node11.html), glutPositionWindow (http://www.opengl.org/documentation/specs/glut/spec3/node22.html), glutReshapeWindow (http://www.opengl.org/resources/libraries/glut/spec3/node23.html)), just not with full screen mode -- where it makes no sense. If you can get the X window ID from GLUT, you'll probably be able to disable the borders.

Dark Photon
02-21-2008, 05:45 AM
This works: 91717-window-without-title-bar.htm (http://fixunix.com/xwindows/91717-window-without-title-bar.html)
That google hit is proving to be somewhat unreliable, so here's the code:


MWMHints mwmhints;
Atom prop;
memset(&mwmhints, 0, sizeof(mwmhints));
prop = XInternAtom(display, "_MOTIF_WM_HINTS", False);
mwmhints.flags = MWM_HINTS_DECORATIONS;
mwmhints.decorations = 0;
XChangeProperty(display, window, prop, prop, 32,
PropModeReplace, (unsigned char *) &mwmhints,
PROP_MWM_HINTS_ELEMENTS);

You just need the display and window handles. Don't know if you can get them from glut. If not, just use X/glX directly.

nt
02-21-2008, 06:09 AM
Thank you "Dark Photon", I will try x/glx since it is much easier in there. just need to set the overrideredirect flag to 1 or 0.

thank you

Dark Photon
02-21-2008, 06:29 AM
just need to set the overrideredirect flag to 1 or 0.
True, but be aware you'll lose the ability to move or close your window via the usual window manager methods (hotkeys, etc.), and allegedly this doesn't play nice with Xinerama.