Resizing Issue with SDL_WINDOW_BORDERLESS on Xorg

Hello I’m learning vulkan and want to create a custom title bar, so I used SDL_WINDOW_BORDERLESS to remove decorations but then resizing got super glitchy i.e. image not updating for seconds I don’t think it’s an issue in swap chain recreation because if I turn on decoration everything works fine also if I run my code in Wayland it works as well its only when using borderless on x11 that I get glitches

here is my code https://pastebin.com/kJmqzVfM

I’m using SDL3 and HitTesting for my window
Any help would be appreciated