Problem with Menus, Cursors, Linux, with patch that solves


We got the following bug report

Using the Cinnamon 5.0.7 desktop on Manjaro Linux, after respectively left- or right-clicking on the Surge XT patch browser rectangle or another component that can open a menu, then clicking outside the focus of the Surge XT window instead of clicking on a menu item or pressing ESC, the mouse pointer will show undefined behavior either regarding pointing mode or visibility.

over in this issue Clicking outside of Surge XT window with open menus can lead to undefined mouse focus behavior · Issue #5692 · surge-synthesizer/surge · GitHub

One of the members of the team spent a bit of time on it and concluded if he adds to bool windowIsStillValid() the following in JUCE/juce_PopupMenu.cpp at master · juce-framework/JUCE · GitHub

        if (doesAnyJuceCompHaveFocus() == false)
            dismissMenu (nullptr);
            return false;

then the reported problem is gone while the menu functions still work. And he doesn’t have a forum account so I figured I would bring it over here for you all!


1 Like

And now I do have an account :slight_smile:
Just adding that, other than the github-issue-excerpt suggests,
the above reported does not seem to be distro/desktop specific.
The same could now be reproduced with default ubuntu 20.

Tl;dr of that (very detailed) report:

  • Surge Standalone: open a popup menu (e.g. patch selector)
  • hover mouse over that menu
  • click on desktop
  • hover back over surge ui
    → mouse stuck in resize mode

Works nice. Thanks a lot!