我试图在xlib中创建没有边框的窗口(弹出窗口?)。我使用此代码:
#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;
}
它创建没有边框的窗口,但此窗口始终位于顶部。 问题是:为什么以及如何在xlib中将其显示为普通窗口。