diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-28 01:04:15 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-28 01:04:15 (GMT) |
commit | e571d1d525359f562074d6922ac06e35ac49b48c (patch) | |
tree | bbb6dbba110c44de83455b0cd49836642b898cea /commands/helpers/xephyr-window.c | |
parent | 016dea75191a76c01362850d4874d27fa0fb13e0 (diff) |
Refactor to use sugar-runner
Diffstat (limited to 'commands/helpers/xephyr-window.c')
-rwxr-xr-x | commands/helpers/xephyr-window.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/commands/helpers/xephyr-window.c b/commands/helpers/xephyr-window.c deleted file mode 100755 index b711f99..0000000 --- a/commands/helpers/xephyr-window.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <X11/Xlib.h> -#include <X11/Xatom.h> - -int main(int argc, char **argv) -{ - Display *display = XOpenDisplay(NULL); - Window window, root_window; - Atom atom; - int width = 100, height = 100; - - if (argc > 1) { - char *geometry = strdup(argv[1]); - char *delimiter = strchr(geometry, 'x'); - - if (delimiter == NULL) { - fprintf(stderr, "Cannot parse geometry\n"); - free(geometry); - exit(1); - } - - *delimiter = '\0'; - width = atoi(geometry); - height = atoi(delimiter + 1); - - free(geometry); - } - - root_window = RootWindow(display, 0); - - window = XCreateSimpleWindow(display, root_window, 0, 0, - width, height, 0, 0, 0); - - printf("%d\n", window); - fflush(stdout); - - if (argc < 2) { - atom = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", True); - XChangeProperty(display, window, - XInternAtom(display, "_NET_WM_STATE", True), - XA_ATOM, 32, PropModeReplace, - (unsigned char *)&atom, 1); - } - - XMapWindow(display, window); - - XFlush(display); - - while(1) { - sleep(60); - } - - XCloseDisplay(display); - - return(0); -} |