Create an XWindow full screen window (Linux Visual Programming)

Source: Internet
Author: User
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;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.