Skip to content

Commit

Permalink
Stop formspecs closing with double-click in empty area
Browse files Browse the repository at this point in the history
Behaviour on Android remains the same until other alternatives can be devised (if possible)

See #2425 (and the many other -- now closed -- issues reporting this feature as a bug)
  • Loading branch information
Zeno- committed Mar 9, 2015
1 parent 3ae16f1 commit 76177c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/guiFormSpecMenu.cpp
Expand Up @@ -2936,6 +2936,16 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event)
/******************************************************************************/
bool GUIFormSpecMenu::DoubleClickDetection(const SEvent event)
{
/* The following code is for capturing double-clicks of the mouse button
* that are *not* in/in a control (i.e. when the mouse if positioned in an
* unused area of the formspec) and translating the double-click into an
* EET_KEY_INPUT_EVENT even which closes the form.
*
* There have been many github issues reporting this as a bug even though it
* was an intended feature. For this reason the code has been disabled for
* non-Android builds
*/
#ifdef __ANDROID__
if (event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN) {
m_doubleclickdetect[0].pos = m_doubleclickdetect[1].pos;
m_doubleclickdetect[0].time = m_doubleclickdetect[1].time;
Expand Down Expand Up @@ -2974,6 +2984,7 @@ bool GUIFormSpecMenu::DoubleClickDetection(const SEvent event)
delete translated;
return true;
}
#endif
return false;
}

Expand Down

0 comments on commit 76177c8

Please sign in to comment.