SHARE
TWEET

Untitled

a guest Dec 14th, 2016 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // X11 Fullscreen window example
  2.  
  3. #include <X11/Xlib.h>
  4.  
  5. int main()
  6. {
  7.     Display* d = XOpenDisplay(NULL);
  8.    
  9.     Window w = XCreateSimpleWindow(d, DefaultRootWindow(d), 0, 0, 200, 100, 0,
  10.                                    BlackPixel(d, DefaultScreen(d)),
  11.                                    WhitePixel(d, DefaultScreen(d)));
  12.     XSelectInput(d, w, StructureNotifyMask);
  13.     XMapWindow(d, w);
  14.    
  15.     XClientMessageEvent msg = {
  16.         .type = ClientMessage,
  17.         .display = d,
  18.         .window = w,
  19.         .message_type = XInternAtom(d, "_NET_WM_STATE", True),
  20.         .format = 32,
  21.         .data = { .l = {
  22.             1 /* _NET_WM_STATE_ADD */,
  23.             XInternAtom(d, "_NET_WM_STATE_FULLSCREEN", True),
  24.             None,
  25.             0,
  26.             1
  27.         }}
  28.     };
  29.    
  30.     XSendEvent(d, DefaultRootWindow(d), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*)&msg);
  31.    
  32.     for (;;)
  33.     {
  34.         XEvent e;
  35.         XNextEvent(d, &e);
  36.     }                      
  37.    
  38.     XCloseDisplay(d);
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top