KDE Plasma 144hz compositing with mixed 144hz/60hz screens

Heres a quick hack which is the result of a few hours of sleuthing.  With a multi monitor setup and some of them running at 144hz and some at 60hz, theres 2 steps to getting that buttery 144hz scrolling and animations (and screensaver) as of 201809 on an up to date gentoo system.

Firstly, edit $HOME/.config/kwinrc and add these 2 lines under [Compositing]:

MaxFPS=144
RefreshRate=144

You also need to force vsync OFF for kwin_x11, else compositing will be locked to the refresh rate of the slower monitors. Tearing will become obvious but mostly on the 60hz monitor(s). Its very hard to see tearing at 144hz. Heres the command I run to switch vsync off for kwin_x11 for the current session:

vblank_mode=0 kwin_x11 --replace &

Setting “Tearing Prevention” to “Never” in Compositor under System Settings appeared to do nothing.