Skip to content

Conversation

@noahc3
Copy link
Owner

@noahc3 noahc3 commented Nov 22, 2025

v1 attempt to fix the color picker zoom preview on Wayland

image

Notes:

  • Due to how the zoom scaling works you end up with pixels being blended (particularly with vector objects where integer scaling doesnt mean anything), this causes the zoom to show one color for the highlighted pixel but the value the picker detects uses some other algorithm to mix colors for that "pixel", so the zoom and picker disagree on the pixel value.
  • To workaround the above issue, users have two options for how the actual color gets selected: NATIVE (unmodified behavior) or EXACT (use color as shown in preview)
    • NATIVE (unmodified behavior) - use the original functionality for how the color picker determines the color value, this means the color picker will disagree on the color value of the highlighted pixel particularly with vector objects where the rasterization differs
    • EXACT (custom behavior) - use the color value of the highlighted pixel in the zoom view, this offers consistency but isn't the original accurate behavior (on the off chance anyone actually cares)
  • Theoretically this issue should exist when running the application on Windows? But perhaps Affinity uses the same scaling method between the two. I need to test this unmodified on Windows and see how it behaves.

This does not fix the issue where the color picker cannot leave the bounds of the canvas on Wayland. Before merging this I want to explore the complexity of adding optional xdg-desktop-portal support for the PickColor service. This would, on supported DEs, replace Affinity's color picker with the native color picker functionality in the DE entirely.

  • If this does get implemented it would be opt-in, not enabled by default, since the quality of this behavior varies by DE/WM/compositor...

Right now choosing between NATIVE and EXACT is done with an environment variable, but I don't love this. So I am considering this PR as blocked by the task to implement a settings service into APL so we can add this as a configurable setting in a WineFix tab in the Affinity preferences dialog, which would be much more user friendly.

@noahc3 noahc3 self-assigned this Nov 22, 2025
@noahc3 noahc3 added winefix wf-patch For bugs that we'd like to patch in WineFix labels Nov 22, 2025
@github-actions
Copy link

github-actions bot commented Nov 22, 2025

⏳ Build In Progress

Commit: e48a528

Building artifacts... This comment will be updated with download links when the build completes.

@noahc3 noahc3 added the blocked label Nov 22, 2025
@noahc3 noahc3 added this to the v0.3 milestone Nov 22, 2025
@higheraims
Copy link

That's awesome, I look forward to trying this out.

@noahc3
Copy link
Owner Author

noahc3 commented Nov 25, 2025

I have started looking at using the color picker through xdg-desktop-portal. It will 100% not be the default. Frankly the color picker available on KDE Plasma is terrible, no magnified view, no color value preview, impossible to tell what you are actually clicking on. The only upside is you can pick from anywhere on the desktop. But that's probably a big enough upside to include, also the picker in other DEs may have a better user experience.

It should be relatively easy to implement. I may see if its feasible to bind it to a modifier key so you can use either the builtin color picker or the xdg color picker as needed without needing to go into preferences to change it. In the future it could be cool to add as a new tool but I think that would be best done with a new API in APL which needs more thought.

I am not 100% sure if xdg color picker will be in v0.3, I will try but if it shapes up to be a bit complex I'll push it out to a future release.

Next steps are building the settings API in APL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked wf-patch For bugs that we'd like to patch in WineFix winefix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WineFix patch: Color picker zoom view is black on Wayland

3 participants