summaryrefslogtreecommitdiff
path: root/src/widget/widget_catchkey.c
diff options
context:
space:
mode:
authorDusan Durech <dusan.d@Centrum.sk>2009-07-15 20:36:23 +0200
committerDusan Durech <dusan.d@Centrum.sk>2009-07-15 20:36:23 +0200
commitd0c088655af27e2e66b164c061e48a5f5bd28f05 (patch)
tree59bb7dd44ff5bed456e84c4195fd4c1bd1aff130 /src/widget/widget_catchkey.c
parentdd094a1c6598648c013ae1483c303eea34fc3bbe (diff)
add new API for mouse and fix bug with crash upon load session
Diffstat (limited to 'src/widget/widget_catchkey.c')
-rw-r--r--src/widget/widget_catchkey.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/widget/widget_catchkey.c b/src/widget/widget_catchkey.c
index b961012..b6290a6 100644
--- a/src/widget/widget_catchkey.c
+++ b/src/widget/widget_catchkey.c
@@ -4,6 +4,7 @@
#include "main.h"
#include "interface.h"
#include "font.h"
+#include "mouse_buffer.h"
#include "widget.h"
#include "widget_catchkey.h"
@@ -95,18 +96,14 @@ static int getPessAnyKey()
void catch_key_event(widget_t *widget)
{
widget_catchkey_t *p;
- int x, y;
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_CATCHKEY);
p = (widget_catchkey_t *) widget->private_data;
- interface_get_mouse_position(&x, &y);
-
- if (interface_is_mouse_clicket()) {
- if (x >= widget->x && x <= widget->x + WIDGET_CATCHKEY_WIDTH &&
- y >= widget->y && y <= widget->y + WIDGET_CATCHKEY_HEIGHT) {
+ if (mouse_buffer_is_on_area(0, 0, 0, 0, MOUSE_BUF_AREA_NONE|MOUSE_BUF_CLICK)) {
+ if (mouse_buffer_is_on_area(widget->x, widget->y, WIDGET_CATCHKEY_WIDTH, WIDGET_CATCHKEY_HEIGHT, MOUSE_BUF_CLICK)) {
p->active = TRUE;
} else {
p->active = FALSE;