I am testing an editor written in tkinter and have noticed some strange behavior. I am using the editor to test the Arabic script which also has composite Glyphs. I have noticed that when I move the cursor over a composite glyph, the glyph is temporarily split into its component glyphs. This can be seen in the two images I have attached to this question. Similar behavior is seen in an app made using PyQt. Notepad++ also does not move the cursor over the entire glyph, instead pausing in the middle of the glyph indicating that the glyph is composed of more than one character.
The one software that does it correctly is the humble Windows Notepad.
I am hoping that there is a way to configure tkinter or PyQt widgets to behave correctly around such glyphs but have no idea where to start looking. Could someone please point me in the right direction?