Dragging toolbar doesn't work despite undocking

After undocking toolbar, the position of the toolbar is fixed on the top of the screen. No matter how I drag it, the toobar just doesn’t move.

I’m using GNOME(wayland) on debian. After some search online, I tried this command:

SAL_USE_VCLPLUGIN=gen libreoffice

It does solve the issue, so I assume forcing LibreOffice to use the X11 backend instead of Wayland will likely solve the issue permanently.

However, X11 has some security issues. Is there a way to make the toolbar move without changing backend on debian?