alpine 3.6
obsolete weakness #24


Weakness Breakdown


An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:



The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

  }); /* window_each(...) */

  while (True) {
    XEvent e;
    xdotool_debug(context, "Waiting for next event...");
    XNextEvent(context->xdo->xdpy, &e);
    xdotool_debug(context, "Got event type %d", e.type);

    // Copy context
    context_t tmpcontext = *context;

    tmpcontext.nwindows = 1;
    Window hover; /* for LeaveNotify */
    switch (e.type) {
      case LeaveNotify:
        /* LeaveNotify is confusing.
         * It is sometimes fired when you are actually entering the window
         * especially at the screen edges. not sure why or what causes it.
         * Work around: Query the window the mouse is over. If it is not
         * us, then we can fire leave.  */

        /* allow some time to pass to let the mouse really leave if we are on our way out */
        /* TODO(sissel): allow this delay to be tunable */
        usleep(100000); /* 100ms */
        xdo_get_window_at_mouse(context->xdo, &hover);
        if (hover == e.xcrossing.window) {
          //printf("Ignoring Leave, we're still in the window\n");
        //printf("Window: %ld\n", e.xcrossing.window);
        //printf("Hover: %ld\n", hover);

        /* fall through */
      case EnterNotify: = &(e.xcrossing.window);
        ret = context_execute(&tmpcontext);
      case FocusIn:
      case FocusOut: = &(e.xfocus.window);
        ret = context_execute(&tmpcontext);
      case ButtonRelease: = &(e.xbutton.window);
        ret = context_execute(&tmpcontext);
        printf("Unexpected event: %d\n", e.type);

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.