SynHighlighterHTML hangs with Range Check Error when open attached HTML-file. The problem appeared after this commit.
Open attached file in the Lazarus code editor.
I can confirm that problem with MainMenu root items is fixed. But the problem still exists with subitems. Also PopupMenu has a same problem.
Steps to reproduce
Execute attached sample program
MainMenu: open MenuItem1, move mouse over MenuItem7 - MenuItem31.
PopupMenu: right click on the form, move mouse over MenuItem17 - MenuItem18.
PopupMenu: right click on the form, open MenuItem17, move mouse over MenuItem19 - MenuItem21.
I can confirm that it works fine with Qt6. I tested Qt5 program with latest Lazarus 3.99 but I don't remember rebuild libQt5Pas or not (I will check). Strange that Qt5 programs like QTerminal and Dolphin works correct.
Submenu showed at the wrong position under GNOME Shell + Wayland, see attached video. Non-Lazarus Qt5 programs like QTerminal does not have such problem. Same program works fine under KDE Plasma + Wayland. So it is some GNOME Shell incompatibility.
Execute sample program under GNOME Shell + Wayland:
./project1 -platform wayland
move window to the screen center, open menu and move mouse over different root items.