Flickering windows when I open tkinter window

I was making a python tkinter ui.

At first the window showed nothing but a standard menu bar. Then after a few tries other windows started to flicker uncontrollably except my obs window for some reason.

I use an Intel core i5 as my main graphics driver since I own a Lenovo Ideapad atm.

Any advice as what could be the cause?

UPDATE: I forgot that Tk mainly works with Xwayland, and due to X11 being outdated for a long time I did not expect some issues.

Also heres my system info.

Arch is x86_64
Host: Lenovo Ideapad 3
Shell: bash 5.1.16
Desktop Environment is Plasma 5.27.7
Kernel Version 6.1.44-1-MANJARO
CPU is Intel Core i5
Intel CometLake-U as my main graphics card.

Mostly had issues with X11 when I had no idea that its no longer developed.
I mainly use kwin as my main window manager.

I don’t know where you got your information, but X11/X.Org is still actively being maintained.

Yes, Wayland is a more modern display protocol, but given how long it has already been under development while it’s still not fully functional in comparison to X11, the latter is still the preferable option.

Given that while X is not yet abandoned … but it is in a perpetually-broken-cannot-fix state … Wayland is actually preferable if it works for you.
I am not going to pretend wayland can fully replace X in all situations - I cannot use wayland myself because of a number of missing features - but for those situations where it works well enough it is usually the more smooth and always the more secure option.