From b4f53f2d827277617b93a6b1c751552b15a0a44d Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 27 Jul 2018 21:30:54 +0200 Subject: [PATCH] Simulate a mouse move for restoring the mouse hover state --- src/button.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/button.cxx b/src/button.cxx index d31ca01..8f51580 100644 --- a/src/button.cxx +++ b/src/button.cxx @@ -275,7 +275,15 @@ CButton::TreatEvent (const SDL_Event & event) pos.x = event.button.x; pos.y = event.button.y; if (MouseUp (pos)) - return false; // (*) + { + /* Simulate a mouse move in order to restore the mouse hover state. */ + SDL_Event ev = {0}; + ev.type = SDL_MOUSEMOTION; + ev.motion.x = pos.x; + ev.motion.y = pos.y; + SDL_PushEvent (&ev); + return false; + } // (*) break; }