Create an XWindow full screen window (Linux Visual Programming)-Linux general technology-Linux programming and kernel information. For details, see the following. In the XWindow environment, creating a full Screen window has two key points. The top left corner of the first window is at (0, 0) and is equal to the Screen width. Second, the window does not need to be managed by the window manager, set override_redirect to True. The following is an example:
CODE: # include
Int main (int argc, char * agrv [])
{
XSetWindowAttributes winattrs;
Int swidth;/* screen width */
Int sheight;/* screen height */
Int winmask;
Display * display;
Int screen;
Window window;
Display = XOpenDisplay (getenv ("DISPLAY "));
Screen = DefaultScreen (display );
Swidth = DisplayWidth (display, screen);/* Get screen width */
Sheight = DisplayHeight (display, screen);/* Get screen height */
Window = XCreateSimpleWindow (display, XDefaultRootWindow (display), 0, 0, swidth, sheight, 0, 0, 0 );
Winattrs. override_redirect = True;
Winmask = CWOverrideRedirect;/* specify to change the override_redirect attribute only */
Xchangeappswattributes (display, window, winmask, & winattrs );
XMapWindow (display, window );
While (1)
{
/* Event loop */
}
Return 0;
} |