diff options
-rw-r--r-- | res/about/version.gmi | 3 | ||||
-rw-r--r-- | src/ui/banner.c | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi index ffd91f7f..020373e4 100644 --- a/res/about/version.gmi +++ b/res/about/version.gmi | |||
@@ -6,6 +6,9 @@ | |||
6 | ``` | 6 | ``` |
7 | # Release notes | 7 | # Release notes |
8 | 8 | ||
9 | ## 1.8.3 | ||
10 | * Fixed clicking on UI elements that are over the page top banner. The banner would always get clicked instead. | ||
11 | |||
9 | ## 1.8.2 | 12 | ## 1.8.2 |
10 | * Fixed encoding of `+` characters in URLs as per RFC 3986. | 13 | * Fixed encoding of `+` characters in URLs as per RFC 3986. |
11 | * Fixed crash when fontpack.ini specifies a file that cannot be found. | 14 | * Fixed crash when fontpack.ini specifies a file that cannot be found. |
diff --git a/src/ui/banner.c b/src/ui/banner.c index 0ffb1d9f..7168f4b2 100644 --- a/src/ui/banner.c +++ b/src/ui/banner.c | |||
@@ -257,8 +257,26 @@ static size_t itemAtCoord_Banner_(const iBanner *d, iInt2 coord) { | |||
257 | return iInvalidPos; | 257 | return iInvalidPos; |
258 | } | 258 | } |
259 | 259 | ||
260 | static iBool isInside_Banner(const iBanner *d, const SDL_Event *ev) { | ||
261 | if (ev->type == SDL_MOUSEMOTION || ev->type == SDL_MOUSEBUTTONDOWN || | ||
262 | ev->type == SDL_MOUSEBUTTONDOWN) { | ||
263 | iInt2 coord; | ||
264 | if (ev->type == SDL_MOUSEMOTION) { | ||
265 | coord = init_I2(ev->motion.x, ev->motion.y); | ||
266 | } | ||
267 | else { | ||
268 | coord = init_I2(ev->button.x, ev->button.y); | ||
269 | } | ||
270 | return contains_Rect(bounds_Widget(constAs_Widget(d->doc)), coord); | ||
271 | } | ||
272 | return iTrue; | ||
273 | } | ||
274 | |||
260 | iBool processEvent_Banner(iBanner *d, const SDL_Event *ev) { | 275 | iBool processEvent_Banner(iBanner *d, const SDL_Event *ev) { |
261 | iWidget *w = as_Widget(d->doc); | 276 | iWidget *w = as_Widget(d->doc); |
277 | if (!isInside_Banner(d, ev)) { | ||
278 | return iFalse; | ||
279 | } | ||
262 | switch (ev->type) { | 280 | switch (ev->type) { |
263 | case SDL_MOUSEMOTION: { | 281 | case SDL_MOUSEMOTION: { |
264 | const iInt2 coord = init_I2(ev->motion.x, ev->motion.y); | 282 | const iInt2 coord = init_I2(ev->motion.x, ev->motion.y); |