Window boarder glitch

i installed kubuntu 22.04 with x11 but the window boarder have some sorta for problem

for some app it works like flatpak steam

in some apps have a weird gray boarder around theme like flatpak firefox

and i some apps it has a black boarder like windscribe

is there any way to fix this??

update: i was able to fix it by switching to wayland