There has been quite a bit of cleanup of the KWindowSystem API, including moving from QWidget* to QWindow*, moving X11-only things to KX11Extras, deprecating some unused things.
There may be more that can be cleaned up though:
[] raiseWindow(Wid). Applications should use QWindow::raise. If Plasma needs it then perhaps move to KX11Extras
[] How do KWindowSystem::activateWindow and QWindow::requestActivate relate?
[] setType smells X11-ish
[] setState smells X11-ish, also unergonimic API and also partically covered by QWindow API
[] ditto for clearState
[] allowedActionsSupported smells X11-ish
[] viewportToDesktop and friends are marked as internal but exposed in the API. Also viewport is a fishy concept
[] setCurrentXdgActivationToken: Create unified abstraction for X11 and Wayland?
[] KWindowInfo:: How much of it is actually used?
[] Make KWindowSystem not inherit NET