xx-fractional-scale-v2 Aims To Improve Wayland Fractional Scaling
#Infrastructure

xx-fractional-scale-v2 Aims To Improve Wayland Fractional Scaling

Hardware Reporter
2 min read

A new experimental Wayland protocol proposes to fix fractional scaling issues by using unscaled pixel coordinates instead of lossy integer logical coordinates.

A new experimental Wayland protocol called xx-fractional-scale-v2 has been proposed to address long-standing issues with fractional scaling on the Wayland display server protocol. The merge request was opened today for Wayland Protocols, with an accompanying implementation already available in KDE's KWin compositor.

The Problem with Current Fractional Scaling

The current Wayland fractional scaling implementation relies on a logical coordinate system that uses integer values. This creates several visual artifacts when using non-integer scaling factors:

  • Gaps between maximized windows and panels - When windows are maximized, small gaps can appear due to rounding errors in the coordinate system
  • Gaps between sub-surfaces - Nested surfaces within applications can misalign
  • Lossy coordinate transformations - Converting between physical and logical coordinates results in precision loss

These issues directly contradict Wayland's core principle that "every frame is perfect" - a design philosophy emphasizing pixel-perfect rendering without visual artifacts.

The xx-fractional-scale-v2 Solution

The proposed protocol introduces a different coordinate space for communicating surface coordinates. Instead of using the current lossy integer logical coordinate space, it allows clients and compositors to work with unscaled pixels directly.

This approach is actually a revival of earlier work by KDE developer Xaver Hugl from 2022. The original proposal was called "wp-fractional-scale-v2" but has been renamed to "xx-fractional-scale-v2" to avoid naming collisions with the prior work.

Implementation Progress

KDE developer Vlad Zahorodnii has already authored a merge request implementing the xx-fractional-scale-v2 protocol in KWin. According to Vlad, "The goal of this protocol is to address some current limitations with the logical coordinate system on Wayland when using fractional scaling. Since the logical coordinate system has not enough resolution, it's possible to have gaps between maximized windows and panels or gaps between sub-surfaces."

Visual Demonstration

The KWin merge request includes a demo application and video recordings that clearly show the difference between current fractional scaling and the proposed implementation. These visual demonstrations highlight how the current system fails to maintain perfect alignment when using fractional scaling factors, while the new approach promises to eliminate these visual artifacts.

What's Next?

The protocol is currently marked as experimental, and it remains to be seen whether it will be adopted as a standard Wayland protocol. However, the clear visual improvements demonstrated in the KWin implementation suggest that this could be a significant step forward for Wayland's fractional scaling capabilities.

The development highlights the ongoing evolution of Wayland as it matures to handle more complex display scenarios while maintaining its commitment to visual perfection.

Comments

Loading comments...