rem: Display *dpy = event->xany.display;
context: static void handleEvents(XEvent * event, void *data){    Ruler *rPtr = (Ruler *) data;    Display *dpy = event->xany.display;    switch (event->type) {      case Expose:        rulerDidResize(rPtr->view->delegate, rPtr->view);       break;      case MotionNotify:      if (rPtr->flags.buttonPressed          && (event->xmotion.state & Button1Mask)) {          if (verifyMarkerMove(rPtr, event->xmotion.x)) {          GC gc = WMColorGC(WMDarkGrayColor(rPtr->view->screen));          if (rPtr->moveAction)              (rPtr->moveAction) (rPtr, rPtr->clientData);          rPtr->flags.redraw = True;          paintRuler(rPtr);          XSetLineAttributes(rPtr->view->screen->display, gc, 1,                     LineSolid, CapNotLast, JoinMiter);          XDrawLine(rPtr->pview->screen->display,                rPtr->pview->window,                gc, rPtr->motion + 1, 40,             rPtr->motion + 1, rPtr->pview->size.height - 5);          }      }      break;      case ButtonPress:      if (event->xbutton.button != Button1)          return;      rPtr->flags.buttonPressed = True;      rPtr->flags.whichMarker =          whichMarker(rPtr, event->xmotion.x,              event->xmotion.y);      break;      case ButtonRelease:      if (event->xbutton.button != Button1)          return;      rPtr->flags.buttonPressed = False;      switch (rPtr->flags.whichMarker) {        case 1:{            int change = rPtr->margins.left - rPtr->motion;            rPtr->margins.first -= change;            rPtr->margins.body -= change;            rPtr->margins.left = rPtr->motion;            rPtr->flags.redraw = True;            paintRuler(rPtr);            break;        }        case 2:        rPtr->margins.right = rPtr->motion;        break;        case 3:        rPtr->margins.first = rPtr->motion;        break;        case 4:        rPtr->margins.body = rPtr->motion;        break;        case 6:        rPtr->margins.first = rPtr->margins.body            = rPtr->motion;        break;      }      if (rPtr->releaseAction)          (rPtr->releaseAction) (rPtr, rPtr->clientData);      break;    }}