summaryrefslogtreecommitdiff
path: root/shared/frame.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-11-06 15:56:07 -0600
committerDerek Foreman <derekf@osg.samsung.com>2015-12-08 13:04:34 -0600
commit9690641bfc91bb8a97a1401e47e19b57225e5285 (patch)
tree1c05b7b815fdd1f47619223abb5b448015272c23 /shared/frame.c
parent3375ccaa278691d53aa38e97bd02b06ddcf653e8 (diff)
cairo-util: return theme location from frame_touch_down
I'll be using this in a follow up patch that adds touch input to weston's wayland backend. Reviewed-by: Daniel Stone <daniels@collabora.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'shared/frame.c')
-rw-r--r--shared/frame.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/shared/frame.c b/shared/frame.c
index 4179b0a8..1b67eb13 100644
--- a/shared/frame.c
+++ b/shared/frame.c
@@ -786,27 +786,27 @@ frame_pointer_button(struct frame *frame, void *data,
return location;
}
-void
+enum theme_location
frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
{
struct frame_touch *touch = frame_touch_get(frame, data);
struct frame_button *button = frame_find_button(frame, x, y);
enum theme_location location;
+ location = theme_get_location(frame->theme, x, y,
+ frame->width, frame->height,
+ frame->flags & FRAME_FLAG_MAXIMIZED ?
+ THEME_FRAME_MAXIMIZED : 0);
+
if (id > 0)
- return;
+ return location;
if (touch && button) {
touch->button = button;
frame_button_press(touch->button);
- return;
+ return location;
}
- location = theme_get_location(frame->theme, x, y,
- frame->width, frame->height,
- frame->flags & FRAME_FLAG_MAXIMIZED ?
- THEME_FRAME_MAXIMIZED : 0);
-
switch (location) {
case THEME_LOCATION_TITLEBAR:
frame->status |= FRAME_STATUS_MOVE;
@@ -824,6 +824,7 @@ frame_touch_down(struct frame *frame, void *data, int32_t id, int x, int y)
default:
break;
}
+ return location;
}
void