Skip to content

Commit

Permalink
Made event handlers consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianremmler committed Dec 15, 2016
1 parent 3a0f3f4 commit 666b6f8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions wjt.c
Expand Up @@ -296,9 +296,8 @@ keypress(XKeyEvent *ev)
}

static void
buttonpress(XEvent *e)
buttonpress(XButtonPressedEvent *ev)
{
XButtonPressedEvent *ev = &e->xbutton;
switch (ev->button) {
case Button1:
xtoval(ev->x_root - winx);
Expand All @@ -316,9 +315,8 @@ buttonpress(XEvent *e)
}

static void
buttonrelease(XEvent *e)
buttonrelease(XButtonReleasedEvent *ev)
{
XButtonReleasedEvent *ev = &e->xbutton;
switch (ev->button) {
case Button1:
xtoval(ev->x_root - winx);
Expand All @@ -335,9 +333,8 @@ buttonrelease(XEvent *e)
}

static void
buttonmove(XEvent *e)
buttonmove(XMotionEvent *ev)
{
XMotionEvent *ev = &e->xmotion;
xtoval(ev->x_root - winx);
drawslider();
}
Expand All @@ -364,13 +361,13 @@ run(void)
keypress(&ev.xkey);
break;
case ButtonPress:
buttonpress(&ev);
buttonpress(&ev.xbutton);
break;
case ButtonRelease:
buttonrelease(&ev);
buttonrelease(&ev.xbutton);
break;
case MotionNotify:
buttonmove(&ev);
buttonmove(&ev.xmotion);
break;
case VisibilityNotify:
if (ev.xvisibility.state != VisibilityUnobscured)
Expand Down

0 comments on commit 666b6f8

Please sign in to comment.