aboutsummaryrefslogtreecommitdiffstats
path: root/xenwatch.c
blob: 84e4ba0462afce30c9efff38433c75f8d9bf9aea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <signal.h>

#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>

#include "xenviews.h"

/* ------------------------------------------------------------------ */

static Display *dpy;

static void sigchild(int signr)
{
    fprintf(stderr,"SIGCHILD\n");
}

/* ------------------------------------------------------------------ */

int
main(int argc, char *argv[])
{
    struct sigaction act, old;

    setlocale(LC_ALL,"");

    memset(&act, 0, sizeof(act));
    act.sa_handler = sigchild;
    sigaction(SIGCHLD, &act, &old);

    gtk_init(&argc, &argv);
    dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default());
    fcntl(ConnectionNumber(dpy),F_SETFD,FD_CLOEXEC);

    xen_doms_create_window();
    gtk_widget_show_all(xd_toplevel);

    gtk_main();

    fprintf(stderr,"bye...\n");
    exit(0);
}