X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmouse.c;h=bb7689281f06c60129be6e430ad0dc4385d041bd;hb=99d0b716776492c1927b8248375ce82a33bc7b26;hp=2624ecb930ab7b5458bcb9c9721d93e44a063b36;hpb=e1fd32bcf5a07d8b9ab774d0f690112dec29cc8e;p=chaz%2Fopenbox diff --git a/openbox/mouse.c b/openbox/mouse.c index 2624ecb9..bb768928 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -14,7 +14,7 @@ typedef struct { guint state; guint button; - GSList *actions[NUM_MOUSEACTION]; /* lists of Action pointers */ + GSList *actions[OB_MOUSE_NUM_ACTIONS]; /* lists of Action pointers */ } ObMouseBinding; /* Array of GSList*s of PointerBinding*s. */ @@ -70,7 +70,7 @@ static void clearall() int j; ObMouseBinding *b = it->data; - for (j = 0; j < NUM_MOUSEACTION; ++j) { + for (j = 0; j < OB_MOUSE_NUM_ACTIONS; ++j) { GSList *it; for (it = b->actions[j]; it; it = it->next) { action_free(it->data); @@ -83,9 +83,9 @@ static void clearall() } } -static void fire_button(ObMouseAction a, ObFrameContext context, - ObClient *c, guint state, - guint button, int x, int y) +static gboolean fire_button(ObMouseAction a, ObFrameContext context, + ObClient *c, guint state, + guint button, int x, int y) { GSList *it; ObMouseBinding *b; @@ -96,7 +96,7 @@ static void fire_button(ObMouseAction a, ObFrameContext context, break; } /* if not bound, then nothing to do! */ - if (it == NULL) return; + if (it == NULL) return FALSE; for (it = b->actions[a]; it; it = it->next) { ObAction *act = it->data; @@ -131,11 +131,12 @@ static void fire_button(ObMouseAction a, ObFrameContext context, act->func(&act->data); } } + return TRUE; } -static void fire_motion(ObMouseAction a, ObFrameContext context, ObClient *c, - guint state, guint button, int x_root, int y_root, - guint32 corner) +static gboolean fire_motion(ObMouseAction a, ObFrameContext context, + ObClient *c, guint state, guint button, + int x_root, int y_root, guint32 corner) { GSList *it; ObMouseBinding *b; @@ -146,7 +147,7 @@ static void fire_motion(ObMouseAction a, ObFrameContext context, ObClient *c, break; } /* if not bound, then nothing to do! */ - if (it == NULL) return; + if (it == NULL) return FALSE; for (it = b->actions[a]; it; it = it->next) { ObAction *act = it->data; @@ -170,6 +171,7 @@ static void fire_motion(ObMouseAction a, ObFrameContext context, ObClient *c, act->func(&act->data); } } + return TRUE; } static guint32 pick_corner(int x, int y, int cx, int cy, int cw, int ch) @@ -204,7 +206,7 @@ void mouse_event(ObClient *client, ObFrameContext context, XEvent *e) button = e->xbutton.button; state = e->xbutton.state; - fire_button(MouseAction_Press, context, + fire_button(OB_MOUSE_ACTION_PRESS, context, client, e->xbutton.state, e->xbutton.button, e->xbutton.x_root, e->xbutton.y_root); @@ -249,18 +251,18 @@ void mouse_event(ObClient *client, ObFrameContext context, XEvent *e) state = 0; ltime = e->xbutton.time; } - fire_button(MouseAction_Release, context, + fire_button(OB_MOUSE_ACTION_RELEASE, context, client, e->xbutton.state, e->xbutton.button, e->xbutton.x_root, e->xbutton.y_root); if (click) - fire_button(MouseAction_Click, context, + fire_button(OB_MOUSE_ACTION_CLICK, context, client, e->xbutton.state, e->xbutton.button, e->xbutton.x_root, e->xbutton.y_root); if (dclick) - fire_button(MouseAction_DClick, context, + fire_button(OB_MOUSE_ACTION_DOUBLE_CLICK, context, client, e->xbutton.state, e->xbutton.button, e->xbutton.x_root, @@ -302,7 +304,7 @@ void mouse_event(ObClient *client, ObFrameContext context, XEvent *e) client->area.height + client->frame->size.top + client->frame->size.bottom); - fire_motion(MouseAction_Motion, context, + fire_motion(OB_MOUSE_ACTION_MOTION, context, client, state, button, px, py, corner); button = 0; state = 0;