I've been working on a cross-platform clipboard manager launcher thing and using xdotool to simulate a ctrl+v on Ubuntu. On every paste though, the entire screen would freeze for a solid second. After a lot of exploring options I came across <a href="https://github.com/robertwayne/libmutter-fix/tree/main">https://github.com/robertwayne/libmutter-fix/tree/main</a>.<p>The TLDR as I understand it is that in Gnome's Mutter, when a keyboard event is received from a different source than the last keyboard event, some expensive operation is kicked off (`keymap_changed`) which is unnecessary for most cases but required to handle something like switching to a keyboard with a different layout than the one last used.<p>The Github repo linked above has more info and links to related issue trackers and discussions. The solution implemented in the repo is to checkout libmutter and just remove the line causing `keymap_changed` to be called for `XkbNewKeyboardNotify` events.<p>Sharing in case anyone else happens to have been banging their head against the wall about this