archived - X11 full-screen unredirection and lots'a settings for KWin
can't maintain this anymore... thanks everyone.
feel free to continue the project if you wish.
KWin-lowlatency is (was?) my attempt to reduce latency and stuttering in the popular KWin compositor used in KDE. since Plasma 5.21 the developers merged official patches which rewrite great parts of the compositing code, putting it on par with former KWin-lowlatency.
however, there's one thing that's not there yet: X11 full-screen unredirection....
the main aim of this project is to add additional settings to the compositor and bring back unredirection based on the direct scanout code. see unredirect.md for more details.
kwin-lowlatency is available in the AUR.
also available as a package in the CachyOS repository. thanks ptr1337!
Manjaro has updated Plasma to 5.23! follow the Arch Linux instructions.
available at home:DarkWav:kwin-lowlatency. Leap is on 5.18 though.
you can compile/install this yourself if your distro isn't listed here, or if you merely want to.
you may need to install specific dependencies before compiling. here you can find a list.
you can get the source code by using any of the following 2 methods:
$ git clone https://github.com/tildearrow/kwin-lowlatency.git
$ cd kwin-lowlatency
if you are not using the latest major version of Plasma (you can check by doing kwin_x11 --version
), you may want to check out the branch for your version, e.g.:
$ git checkout Plasma/5.23
you may want to check the current stable version out:
$ git checkout v5.23.5
download stock KWin source and patch file:
$ wget https://download.kde.org/stable/plasma/5.23.5/kwin-5.23.5.tar.xz
$ wget https://tildearrow.org/storage/kwin-lowlatency/kwin-lowlatency-5.23.5.patch
extract:
$ tar -xvf kwin-5.23.5.tar.xz
patch:
$ cd kwin-5.23.5
$ patch -p1 < ../kwin-lowlatency-5.23.5.patch
Ubuntu uses a different library path, which means you'll have to tweak the library dir:
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_INSTALL_LIBEXECDIR=lib/x86_64-linux-gnu -DBUILD_TESTING=OFF ..
$ make
$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_LIBEXECDIR=lib -DBUILD_TESTING=OFF ..
$ make
$ sudo make install
KWin-lowlatency introduces a few options in System Settings > Display and Monitor > Compositor. these options are documented in this section.
the options are:
OpenGLIsUnsafe
when it detects initialization problems. on vanilla KWin there is a bug which triggers a false-positive when KWin takes too long to start (e.g. on an HDD).__GL_MaxFramesAllowed
to 1 which ensures the compositor will wait for vertical blank (use in conjunction with VSync mechanism described below). has no effect on AMD and Intel graphics.GLX_SGI_video_sync
extension otherwise (NVIDIA) or GLX_OML_sync_control
if the former isn't available.GLX_INTEL_swap_event
extension (implemented by Mesa) for detecting the vertical blank. ironically this is not the default for Intel graphics due to some reason.GLX_SGI_video_sync
extension to determine the next vertical blank.GLX_OML_sync_control
extension to determine the next vertical blank. not available on NVIDIA, or at least not yet.GLX_SGI_video_sync
extension, but poll every millisecond until the next vertical blank interval occurs. this option is there because there was a bug in Mesa which caused hangs when using the wait functions.what's this "Paint cursor" effect in Desktop Effects?
it's an effect I wrote back in 2018 when experimenting with kmsgrab for some private recordings. it basically redraws the cursor. this may seem redundant, but actually is helpful for recording with kmsgrab (since it doesn't draw the hardware sprite).
the following applications may benefit from the usage of this effect:
will this work under Wayland?
it probably will, but there isn't too much difference
do you have any plans to upstream this?
the unredirection part? maybe. I'll think about it.
unredirection is not working.
please see unredirect.md for known issues. you may file a bug report as well.
use the issues section at the top. but wait! before reporting an issue, first test it again on the official KWin to determine whether this is really a KWin-lowlatency-only bug.
if the bug also reproduces in official KWin, please file a bug on their bug tracker instead.
the hacking documentation has information on how to build and start KWin.