diff options
Diffstat (limited to 'apps/gui/skin_engine/skin_touchsupport.c')
-rw-r--r-- | apps/gui/skin_engine/skin_touchsupport.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c index e1a7d0688e..beb6780c3c 100644 --- a/apps/gui/skin_engine/skin_touchsupport.c +++ b/apps/gui/skin_engine/skin_touchsupport.c | |||
@@ -62,6 +62,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
62 | bool released = (type == BUTTON_REL); | 62 | bool released = (type == BUTTON_REL); |
63 | bool pressed = (type == BUTTON_TOUCHSCREEN); | 63 | bool pressed = (type == BUTTON_TOUCHSCREEN); |
64 | struct skin_token_list *regions = data->touchregions; | 64 | struct skin_token_list *regions = data->touchregions; |
65 | bool needs_repeat; | ||
65 | 66 | ||
66 | while (regions) | 67 | while (regions) |
67 | { | 68 | { |
@@ -72,6 +73,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
72 | regions = regions->next; | 73 | regions = regions->next; |
73 | continue; | 74 | continue; |
74 | } | 75 | } |
76 | needs_repeat = r->press_length != PRESS; | ||
75 | /* check if it's inside this viewport */ | 77 | /* check if it's inside this viewport */ |
76 | if (viewport_point_within_vp(&(r->wvp->vp), x, y)) | 78 | if (viewport_point_within_vp(&(r->wvp->vp), x, y)) |
77 | { /* reposition the touch inside the viewport since touchregions | 79 | { /* reposition the touch inside the viewport since touchregions |
@@ -87,22 +89,10 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
87 | vy -= r->y; | 89 | vy -= r->y; |
88 | 90 | ||
89 | 91 | ||
90 | switch(r->type) | 92 | switch(r->action) |
91 | { | 93 | { |
92 | case WPS_TOUCHREGION_ACTION: | 94 | case ACTION_TOUCH_SCROLLBAR: |
93 | if (r->armed && ((repeated && r->repeat) || (released && !r->repeat))) | 95 | case ACTION_TOUCH_VOLUME: |
94 | { | ||
95 | last_action = r->action; | ||
96 | returncode = r->action; | ||
97 | temp = r; | ||
98 | } | ||
99 | if (pressed) | ||
100 | { | ||
101 | r->armed = true; | ||
102 | r->last_press = current_tick; | ||
103 | } | ||
104 | break; | ||
105 | default: | ||
106 | if (edge_offset) | 96 | if (edge_offset) |
107 | { | 97 | { |
108 | if(r->width > r->height) | 98 | if(r->width > r->height) |
@@ -112,8 +102,22 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
112 | if (r->reverse_bar) | 102 | if (r->reverse_bar) |
113 | *edge_offset = 100 - *edge_offset; | 103 | *edge_offset = 100 - *edge_offset; |
114 | } | 104 | } |
115 | returncode = r->type; | ||
116 | temp = r; | 105 | temp = r; |
106 | returncode = r->action; | ||
107 | break; | ||
108 | default: | ||
109 | if (r->armed && ((repeated && needs_repeat) || | ||
110 | (released && !needs_repeat))) | ||
111 | { | ||
112 | last_action = r->action; | ||
113 | returncode = r->action; | ||
114 | temp = r; | ||
115 | } | ||
116 | if (pressed) | ||
117 | { | ||
118 | r->armed = true; | ||
119 | r->last_press = current_tick; | ||
120 | } | ||
117 | break; | 121 | break; |
118 | } | 122 | } |
119 | } | 123 | } |
@@ -126,6 +130,8 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset, | |||
126 | skin_disarm_touchregions(data); | 130 | skin_disarm_touchregions(data); |
127 | if (retregion && temp) | 131 | if (retregion && temp) |
128 | *retregion = temp; | 132 | *retregion = temp; |
133 | if (temp && temp->press_length == LONG_PRESS) | ||
134 | temp->armed = false; | ||
129 | 135 | ||
130 | if (returncode != ACTION_NONE) | 136 | if (returncode != ACTION_NONE) |
131 | { | 137 | { |