I have try to quit a software propely with Xlibe but don’t find the way.
Here is the source of the X11 program:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h>
void expose (Display *display,Window win,GC gc)
{
XDrawString (display, win, gc, 10, 30, "Hello, world !", 20);
}
int main()
{
Display *display;
Window win;
GC gc;
int running=1;
display = XOpenDisplay (NULL);
win = XCreateSimpleWindow (display, RootWindow( display, 0 ),
0, 0,
120, 90,
1, BlackPixel(display,0), WhitePixel(display,0));
gc = XCreateGC( display, win, 0, 0 );
Atom wmDeleteMessage = XInternAtom(display, "WM_DELETE_WINDOW", False);
XSelectInput (display, win, ExposureMask);
XStoreName (display, win, "xsimple");
XMapWindow (display, win);
while (running) {
XEvent ev;
char c;
XNextEvent (display, &ev);
switch (ev.type) {
case Expose:
expose (display,win,gc);
break;
case ClientMessage:
if (ev.xclient.data.l[0] == wmDeleteMessage){
XDestroyWindow(display,win);
printf("Hello");
running = 0;
}
break;
default :
break;
}
}
XCloseDisplay(display);
return 0;
}
Also I returned to GTK+, that work but I signal this message I have in terminal when I launch a GTK app:
GLib-GIO-WARNING **: 15:57:03.018: Failed to create file monitor for /boot/home/config/settings/glib-2.0/settings/keyfile: Impossible de trouver le type de moniteur de fichier local par défaut
“Not possible to find the kind of local file monitor by default”