xdemo.c
changeset 48 b94d657a9acb
parent 27 81a574d60c15
child 77 49e0babccb23
equal deleted inserted replaced
47:63adb261de90 48:b94d657a9acb
    17 
    17 
    18     int active;
    18     int active;
    19 
    19 
    20     if (dpy == NULL) {
    20     if (dpy == NULL) {
    21         printf ("Error opening localhost:0\n");
    21         printf ("Error opening localhost:0\n");
    22         return EXIT_SUCCESS;
    22         return EXIT_FAILURE;
    23     }
    23     }
    24 
    24 
    25     XSynchronize (dpy, 1);
    25     XSynchronize (dpy, 1);
    26     w = XCreateSimpleWindow (dpy, DefaultRootWindow (dpy), 0, 0, 240, 60, 1, 1, 1);
    26     w = XCreateSimpleWindow (dpy, DefaultRootWindow (dpy), 0, 0, 240, 60, 1, 1, 1);
    27 
    27 
    28     if (w < 0)
    28     if (w < 0)
    29         return EXIT_SUCCESS;
    29         return EXIT_FAILURE;
    30 
    30 
    31     printf ("WINDOW-ID: %ld\n", w);
    31     printf ("WINDOW-ID: %ld\n", w);
    32 
    32 
    33     XRaiseWindow (dpy, w);
    33     XRaiseWindow (dpy, w);
    34     XMapWindow (dpy, w);
    34     XMapWindow (dpy, w);