int border_xsize = gi->border.xsize;
int border_ysize = gi->border.ysize;
int button_size = gi->border.xsize_selectbutton;
+ int bottom_screen_border = gfx.sy + gfx.sysize - font_height;
Bitmap *src_bitmap;
int src_x, src_y;
gi->selectbox.x = gi->x;
gi->selectbox.y = gi->y + gi->height;
- if (gi->selectbox.y + gi->selectbox.height > gfx.real_sy + gfx.full_sysize)
+ if (gi->selectbox.y + gi->selectbox.height > bottom_screen_border)
gi->selectbox.y = gi->y - gi->selectbox.height;
if (gi->selectbox.y < 0)
- gi->selectbox.y = gfx.real_sy + gfx.full_sysize - gi->selectbox.height;
+ gi->selectbox.y = bottom_screen_border - gi->selectbox.height;
getFontCharSource(font_nr, FONT_ASCII_CURSOR, &src_bitmap, &src_x, &src_y);
src_x += font_width / 2;
if (gadget_list_first_entry == NULL)
return;
+ /* simulated release of mouse button over last gadget */
+ if (mx == -1 && my == -1 && button == 0)
+ {
+ mx = last_mx;
+ my = last_my;
+ }
+
/* check which gadget is under the mouse pointer */
new_gi = getGadgetInfoFromMousePosition(mx, my);
gi->event_mask & GD_EVENT_OFF_BORDERS)
gi->callback_action(gi);
}
+
+ /* handle gadgets unmapped/mapped between pressing and releasing */
+ if (release_event && !gadget_released && new_gi)
+ new_gi->state = GD_BUTTON_UNPRESSED;
}
void HandleGadgetsKeyInput(Key key)