diff options
Diffstat (limited to 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index b9fb12b9..2a889683 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -424,9 +424,9 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) { | |||
424 | return iTrue; | 424 | return iTrue; |
425 | } | 425 | } |
426 | } | 426 | } |
427 | else if (d->flags & commandOnClick_WidgetFlag && (ev->type == SDL_MOUSEBUTTONDOWN || | 427 | else if (d->flags & commandOnClick_WidgetFlag && |
428 | ev->type == SDL_MOUSEBUTTONUP) && | 428 | (ev->type == SDL_MOUSEBUTTONDOWN || ev->type == SDL_MOUSEBUTTONUP) && |
429 | contains_Widget(d, init_I2(ev->button.x, ev->button.y))) { | 429 | (mouseGrab_Widget() == d || contains_Widget(d, init_I2(ev->button.x, ev->button.y)))) { |
430 | postCommand_Widget(d, | 430 | postCommand_Widget(d, |
431 | "mouse.clicked arg:%d button:%d coord:%d %d", | 431 | "mouse.clicked arg:%d button:%d coord:%d %d", |
432 | ev->type == SDL_MOUSEBUTTONDOWN ? 1 : 0, | 432 | ev->type == SDL_MOUSEBUTTONDOWN ? 1 : 0, |
@@ -435,6 +435,11 @@ iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) { | |||
435 | ev->button.y); | 435 | ev->button.y); |
436 | return iTrue; | 436 | return iTrue; |
437 | } | 437 | } |
438 | else if (d->flags & commandOnClick_WidgetFlag && | ||
439 | mouseGrab_Widget() == d && ev->type == SDL_MOUSEMOTION) { | ||
440 | postCommand_Widget(d, "mouse.moved coord:%d %d", ev->motion.x, ev->motion.y); | ||
441 | return iTrue; | ||
442 | } | ||
438 | switch (ev->type) { | 443 | switch (ev->type) { |
439 | case SDL_USEREVENT: { | 444 | case SDL_USEREVENT: { |
440 | if (ev->user.code == command_UserEventCode && d->commandHandler && | 445 | if (ev->user.code == command_UserEventCode && d->commandHandler && |