<commit_before>#include "futile.h"
#include "config.h"

int main()
{
    Display* dpy = XOpenDisplay(NIL);
    XButtonEvent btn;
    Window win;
    XWindowAttributes attr;
    int screenWidth = WidthOfScreen(DefaultScreenOfDisplay(dpy));
    int screenHeight = HeightOfScreen(DefaultScreenOfDisplay(dpy));
    int focus;
    XEvent ev;
    XGrabButton(dpy,1,Mod4Mask,DefaultRootWindow(dpy),False,ButtonPressMask|ButtonReleaseMask|PointerMotionMask,GrabModeAsync,GrabModeAsync,None,None);
    XGrabButton(dpy,3,Mod4Mask,DefaultRootWindow(dpy),False,ButtonPressMask|ButtonReleaseMask|PointerMotionMask,GrabModeAsync,GrabModeAsync,None,None);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_Return),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_d),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_Tab),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_x),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    btn.subwindow = None;
    for(;;)
    {
        XNextEvent(dpy,&ev);
        if(ev.type == KeyPress)
        {
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_Return)) create_process(term);
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_d)) 
            {
                create_process(browser);
            }
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_Tab)) {}
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_x))
            {
                XGetInputFocus(dpy,&win,&focus);
                XResizeWindow(dpy,win,screenWidth,screenHeight);
                XMoveWindow(dpy,win,0,0);
            }
        }
        if(ev.type == ButtonPress && ev.xbutton.subwindow != None)
        {
            XGetWindowAttributes(dpy, ev.xbutton.subwindow, &attr);<commit_msg>On peut annuler le fullscreen<commit_after>#include "futile.h"
#include "config.h"

int main()
{
    Display* dpy = XOpenDisplay(NIL);
    XButtonEvent btn;
    Window win;
    XWindowAttributes attr;
    unsigned int screenWidth = WidthOfScreen(DefaultScreenOfDisplay(dpy));
    unsigned int screenHeight = HeightOfScreen(DefaultScreenOfDisplay(dpy));
    unsigned int winWidth;
    unsigned int winHeight;
    int winX,winY;
    int focus;
    XEvent ev;
    XGrabButton(dpy,1,Mod4Mask,DefaultRootWindow(dpy),False,ButtonPressMask|ButtonReleaseMask|PointerMotionMask,GrabModeAsync,GrabModeAsync,None,None);
    XGrabButton(dpy,3,Mod4Mask,DefaultRootWindow(dpy),False,ButtonPressMask|ButtonReleaseMask|PointerMotionMask,GrabModeAsync,GrabModeAsync,None,None);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_Return),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_d),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_Tab),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    XGrabKey(dpy,XKeysymToKeycode(dpy,XK_x),Mod4Mask,DefaultRootWindow(dpy),False,GrabModeAsync,GrabModeAsync);
    btn.subwindow = None;
    for(;;)
    {
        XNextEvent(dpy,&ev);
        if(ev.type == KeyPress)
        {
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_Return)) create_process(term);
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_d)) 
            {
                create_process(browser);
            }
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_Tab)) {}
            if(ev.xkey.keycode == XKeysymToKeycode(dpy,XK_x))
            {
                int x_return, y_return;
                unsigned int width_return,height_return,border_width_return,depth_return;
                Window root_return;
                XGetInputFocus(dpy,&win,&focus);
                XGetGeometry(dpy,win,&root_return,&x_return,&y_return,&width_return,&height_return,&border_width_return,&depth_return);
                if(width_return == screenWidth && height_return == screenHeight) 
                {
                    XMoveResizeWindow(dpy,win,winX,winY,winWidth,winHeight);
                }
                else 
                {
                    winX = x_return;
                    winY = y_return;
                    winWidth = width_return;
                    winHeight = height_return;
                    XMoveResizeWindow(dpy,win,0,0,screenWidth,screenHeight);
                }
                fprintf(stderr,"%ix%i",winWidth,winHeight);
            }
        }
        if(ev.type == ButtonPress && ev.xbutton.subwindow != None)
        {
            XGetWindowAttributes(dpy, ev.xbutton.subwindow, &attr);
{'fraction_non_alphanumeric': 0.11215552232428969, 'fraction_numerical': 0.004272591326639607, 'mean_word_length': 3.268003646308113, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '28034', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1572, 'n_words': 150}