mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-05 22:04:57 +00:00
(svn r12999) -Fix [FS#1995]: when a Window got deleted on a double click event, we should not send a click event to the now non-existant Window as that causes segfaults.
This commit is contained in:
parent
5e1516e486
commit
19910188fa
@ -1931,9 +1931,14 @@ void MouseLoop(MouseClick click, int mousewheel)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (click) {
|
switch (click) {
|
||||||
case MC_DOUBLE_LEFT: DispatchLeftClickEvent(w, x - w->left, y - w->top, true);
|
case MC_DOUBLE_LEFT:
|
||||||
/* fallthough, and also give a single-click for backwards compatible */
|
DispatchLeftClickEvent(w, x - w->left, y - w->top, true);
|
||||||
case MC_LEFT: DispatchLeftClickEvent(w, x - w->left, y - w->top, false); break;
|
if (_mouseover_last_w == NULL) break; // The window got removed.
|
||||||
|
/* fallthough, and also give a single-click for backwards compatibility */
|
||||||
|
case MC_LEFT:
|
||||||
|
DispatchLeftClickEvent(w, x - w->left, y - w->top, false);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
|
if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
|
||||||
/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
|
/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
|
||||||
|
Loading…
Reference in New Issue
Block a user