Ticket #3194: reproduce_bug_worse.patch

File reproduce_bug_worse.patch, 1.0 KB (added by elexis, 7 years ago)
  • source/gui/CGUI.cpp

    InReaction CGUI::HandleEvent(const SDL_E  
    7373
    7474        std::map<CStr, std::vector<IGUIObject*> >::iterator it = m_HotkeyObjects.find(hotkey);
    7575        if (it != m_HotkeyObjects.end())
    7676            for (IGUIObject* const& obj : it->second)
    7777            {
    78                 // Update hotkey status before sending the event,
    79                 // else the status will be outdated when processing the GUI event.
    80                 HotkeyInputHandler(ev);
    81                 ret = IN_HANDLED;
    82 
    83                 if (ev->ev.type == SDL_HOTKEYDOWN)
    84                     obj->SendEvent(GUIM_PRESSED, "press");
    85                 else
    86                     obj->SendEvent(GUIM_RELEASED, "release");
     78                if ((ev->ev.type == SDL_HOTKEYDOWN && obj->SendEvent(GUIM_PRESSED, "press") == IN_HANDLED) ||
     79                    (ev->ev.type == SDL_HOTKEYUP && obj->SendEvent(GUIM_RELEASED, "release") == IN_HANDLED))
     80                {
     81                    ret = IN_HANDLED;
     82                }
    8783            }
    8884    }
    8985
    9086    else if (ev->ev.type == SDL_MOUSEMOTION)
    9187    {