Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • W wayland-protocols
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 109
    • Issues 109
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 56
    • Merge requests 56
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • waylandwayland
  • wayland-protocols
  • Merge requests
  • !149

wp-fractional-scale-v2: alternative fractional scaling support by changing coordinate spaces

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Xaver Hugl requested to merge Zamundaaa/wayland-protocols:work/fractional-scaling into main May 18, 2022
  • Overview 46
  • Commits 1
  • Pipelines 7
  • Changes 2

Fractional scaling is a way of scaling user interfaces that allows for non-integer scaling factors. In order to support multiple displays with different fractional scaling factors properly and prevent size mismatches in all relevant situations, multiple coordinate spaces need to be used. This commit adds a protocol that adds the ability for compositor and client to change the coordinate space of their communication for that purpose.

I opted to make all coordinates be scaled, including input, to have all of them still be in a unified coordinate space and possibly reduce some confusion. Because it shouldn't matter in practice though, if anyone prefers to not scale input, I'd be willing to change that as well.

Advantages of this approach:

  • toolkits can adopt the protocol without breaking any compatibility with clients, assuming they have any existing support for fractional scaling. This is especially relevant with "toolkits" like Wine, where neither API nor clients will adapt to Wayland
  • coordinates are still commutative, meaning that all calculations regarding positions and sizes stay simple and intuitive
  • clients can position subsurfaces on a granularity of one pixel
  • compositors can request surface sizes with a resolution of one pixel, ensuring that there are never gaps between toplevels without requiring additional logic
  • not directly an advantage of the protocol but still: compositors implementing this can easily provide the option to change the scale per client

Disadvantages of this approach:

  • compositor implementations must use either floating point coordinates or pixel coordinates to ensure 1:1 pixel mapping
  • compositor implementations must transform between their internal coordinate space to client coordinate spaces

Signed-off-by: Xaver Hugl xaver.hugl@gmail.com

cc #47 (closed)

Implementations:

  • wlroots: wlroots/wlroots!3809
  • KWin: https://invent.kde.org/plasma/kwin/-/merge_requests/3170
  • glfw: https://github.com/glfw/glfw/pull/2215
Edited Nov 06, 2022 by Xaver Hugl
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/fractional-scaling