Skip to content

Instantly share code, notes, and snippets.

@brandon3055
Last active August 19, 2018 20:25
Show Gist options
  • Save brandon3055/4a41e444960a90f394da35c301b1729f to your computer and use it in GitHub Desktop.
Save brandon3055/4a41e444960a90f394da35c301b1729f to your computer and use it in GitHub Desktop.

Revisions

  1. brandon3055 renamed this gist Aug 19, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. brandon3055 created this gist Aug 19, 2018.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    void Tests::test() {
    disp = XOpenDisplay(NULL);
    Window window = XDefaultRootWindow(disp);
    // xdo_get_active_window(xdo1, &window); // Gets CLion Window

    XSetWindowAttributes attributes;
    attributes.event_mask = ExposureMask | KeyPressMask |
    StructureNotifyMask | ButtonReleaseMask |
    KeyReleaseMask | EnterWindowMask | LeaveWindowMask |
    PointerMotionMask | Button1MotionMask | VisibilityChangeMask |
    ColormapChangeMask;
    attributes.override_redirect = False;
    XChangeWindowAttributes(disp, window, CWOverrideRedirect, &attributes);

    XEvent xeEvent;
    while (True) {
    printf("Loop Start.\n");
    XNextEvent(disp, &xeEvent);
    printf("Event Fired!\n");
    }
    }