I'm trying to create window without borders (popup?) in xlib. I'm using this code:
#include <stdio.h>
#include <X11/Xlib.h>
int main( int argc, char **argv )
{
Display *display = NULL;
Window window;
XSetWindowAttributes attribs;
display = XOpenDisplay( NULL );
if( !display )
{
printf( "Cannot to open display." );
return 1;
}
attribs.override_redirect = 1;
window = XCreateWindow( display, RootWindow(display, 0), 20, 20, 400, 300, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect, &attribs );
XSetWindowBackground( display, window, 0x00F0FF );
XClearWindow( display, window );
XMapWindow( display, window );
XFlush( display );
getchar( );
return 0;
}
It creating window without borders, but this window is always on top. The question is: Why and what to do in xlib to display it as a normal window.