Guest User

move window

a guest
Feb 10th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <X11/Xlib.h>
  3.  
  4. int main (int argc, char**argv)
  5. {
  6.     Display *display;
  7.     Window  window;
  8.     XSetWindowAttributes attributes;
  9.     Visual *visual;
  10.     int depth;
  11.     int screen;
  12.     char s[3];
  13.  
  14.     display = XOpenDisplay(NULL);
  15.     screen = DefaultScreen(display);
  16.     visual = DefaultVisual(display,screen);
  17.     depth  = DefaultDepth(display,screen);
  18.     attributes.background_pixel = XWhitePixel(display,screen);
  19.     attributes.override_redirect = True;
  20.  
  21.     window = XCreateWindow( display,XRootWindow(display,screen),
  22.                             200, 200, 350, 200, 5, depth,  InputOutput,
  23.                             visual,  CWOverrideRedirect|CWBackPixel, &attributes);
  24.  
  25.     XMoveWindow(display, window, 1000, 1000);
  26.  
  27.     XMapWindow(display, window);
  28.  
  29.     XFlush(display);
  30.  
  31.     fgets(s, 2, stdin);
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment