X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmouse.c;h=bb7689281f06c60129be6e430ad0dc4385d041bd;hb=1045079482453424f8320de99639390e3020eb72;hp=6651a1f2c1c39d73e34da2140c78e7cc69d86d5a;hpb=8529aab619c0f26a79cd49ec0f8910433a541263;p=chaz%2Fopenbox diff --git a/openbox/mouse.c b/openbox/mouse.c index 6651a1f2..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; @@ -121,19 +121,22 @@ static void fire_button(ObMouseAction a, ObFrameContext context, act->data.sendtodir.cancel = FALSE; } - if ((act->func == action_desktop_dir || - act->func == action_send_to_desktop_dir)) { + if (config_desktop_popup && + (act->func == action_desktop_dir || + act->func == action_send_to_desktop_dir)) + { keyboard_interactive_grab(state, c, context, act); } 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; @@ -144,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; @@ -168,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) @@ -202,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); @@ -247,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, @@ -300,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;