Open wyattbiker opened 2 weeks ago
When enabled, the Context Menu of RichTextLabel fires a mouse_exited event when you right click on the label. In addition, mousing over the Context Menu keeps firing mouse_exited/mouse_entered events. This interferes with the ability to use mouse_exited() with Context Menu at the same time.
That's how it is supposed to work, context menu is a separate window and hovering it should emit enter/exit events on both parent window and menu window. Not sure what's the issue.
As an example I have a custom RichTextLabel tooltip being displayed. The tooltip closes when you mouse exit from it, Also the tooltip allows the user to select text and right click to get the context menu. That particular action closes the tooltip, before the user selects from the Context Menu
Attached is a simple demo. Tooltip is displayed when you hover over the main control. When you hover over the tooltip and then away the tooltip closes. If you display tooltip again and then select text ad Right Click the tooltip closes. This should not be happening, I don't know why it needs to emit a mouse exited since the mouse did not exit.
P.S. This is why the Editor Inspector does not have a Context menu enabled on it's own property tooltips. Whoever coded that had an issue but decided to just allow select text and then use CTRL+C
Attached is a simple demo to show the issue. tooltip_demo.zip
Here is a screencast:
https://github.com/user-attachments/assets/d930fb3a-d2fe-4ef9-8556-0e38fd98afb0
Tested versions
v4.3.stable.official [77dcf97d8]
System information
Linux Kubuntu 24.04 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.8.0-39-generic (64-bit) Graphics Platform: X11 Processors: 16 × 12th Gen Intel® Core™ i7-1260P Memory: 15.3 GiB of RAM
Issue description
When enabled, the Context Menu of RichTextLabel fires a mouse_exited event when you right click on the label. In addition, mousing over the Context Menu keeps firing mouse_exited/mouse_entered events. This interferes with the ability to use mouse_exited() with Context Menu at the same time.
However no such event is fired when Context Menu is disabled. Also mouse Left Click has no effect.
Here is the code of the single scene above:
Steps to reproduce
Add a RichtextLabel control to a scene with some text. Enable the Context Menu. Add mouse_exited event as above. Right click and event fires even though you did not exit the label. Mouse over Context Menu and the events keep firing.
Minimal reproduction project (MRP)
Attached is the above scene to demo the issue. Please add to an empty project if you wish to try it.
node_2d.zip