mirror of https://github.com/OpenTTD/OpenTTD
(svn r18744) -Fix [FS#3487-ish]: Do not toggle the sticky- and shading-button twice per mouseclick when clicking fast.
parent
e0bf5da9ed
commit
70f96a3dbf
|
@ -282,6 +282,8 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
|
|||
|
||||
int widget_index = nw->index; ///< Index of the widget
|
||||
|
||||
/* Process special buttons (only single clicks) */
|
||||
if (!double_click) {
|
||||
/* Clicked on a widget that is not disabled.
|
||||
* So unless the clicked widget is the caption bar, change focus to this widget */
|
||||
if (widget_type != WWT_CAPTION) {
|
||||
|
@ -358,6 +360,7 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Widget has no index, so the window is not interested in it. */
|
||||
if (widget_index < 0) return;
|
||||
|
@ -2118,12 +2121,13 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
|||
}
|
||||
} else {
|
||||
switch (click) {
|
||||
case MC_DOUBLE_LEFT:
|
||||
DispatchLeftClickEvent(w, x - w->left, y - w->top, true);
|
||||
if (_mouseover_last_w == NULL) break; // The window got removed.
|
||||
/* fallthough, and also give a single-click for backwards compatibility */
|
||||
case MC_LEFT:
|
||||
case MC_DOUBLE_LEFT:
|
||||
DispatchLeftClickEvent(w, x - w->left, y - w->top, false);
|
||||
if (click == MC_DOUBLE_LEFT && _mouseover_last_w != NULL) {
|
||||
/* Issue the doubleclick, if the window was not removed */
|
||||
DispatchLeftClickEvent(w, x - w->left, y - w->top, true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue