Fix colord profile installation failures on Wayland - #974
Open
ahjulstad wants to merge 1 commit into
Open
Conversation
Generated with AI assistance by goose (AAIF). Three issues fixed: 1. CDTimeoutError when importing profile into colord: DisplayCAL computes the colord profile ID from the ICC profile.ID header, but colord actually uses md5(file_contents) as its internal ID. The query_colord_for_newly_added_profile function searches by the wrong ID and always times out after 5 seconds. Added a fallback that uses `colormgr find-profile-by-filename` to locate the just-imported profile by its filename, which is locale-independent and works regardless of the ID scheme colord uses. 2. Wrong MAPPING_device_id in profile metadata: On Wayland, xrandr does not expose EDID blocks, so display_edid is empty for all displays. The MAPPING_device_id was set using get_device_id(quirk=False) without query=True, which could not query colord for the correct device ID. Changed to use query=True (matching the same call in worker.py line 13559), with a fallback to the non-query version. 3. EDID dict key type mismatch (bytes vs str): display_cal.py used bytes keys (b"monitor_name", b"hash") to look up EDID fields, but edid.py stores them with str keys. This prevented EDID-based display matching from ever working. Now checks both str and bytes keys.
Author
|
This one might be a bit too ugly, no offense taken if you just discard this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated with AI assistance by goose (AAIF).
Problem
After calibration and profiling, DisplayCAL fails to install the ICC profile via colord on Wayland systems. Three issues were identified:
1. CDTimeoutError — profile ID mismatch
DisplayCAL computes the colord profile ID from the ICC
profile.IDheader ("icc-" + hexlify(profile.ID)), but colord uses"icc-" + md5(file_contents)as its internal ID. Thequery_colord_for_newly_added_profile()function searches by the wrong ID and always times out after 5 seconds, raisingCDTimeoutError.2. Wrong MAPPING_device_id in profile metadata
On Wayland,
xrandr --verbosedoes not expose EDID blocks, sodisplay_edidis empty for all displays. TheMAPPING_device_idwas set usingget_device_id(quirk=False)withoutquery=True, which could not query colord for the correct device ID. This caused the profile to be tagged with the wrong display device.3. EDID dict key type mismatch (bytes vs str)
display_cal.pyused bytes keys (b"monitor_name",b"hash") to look up EDID fields, butedid.pystores them with str keys. This prevented EDID-based display matching from ever working.Fixes
colord.py: Added
_find_profile_by_filename()fallback that usescolormgr find-profile-by-filenameto locate the just-imported profile when the ID-based lookup times out. The object path is parsed from colormgr output by matching the/org/freedesktop/ColorManager/pattern, making it locale-independent.display_cal.py: Changed
get_device_id(quirk=False)toget_device_id(quirk=False, query=True)(matching the same pattern already used inworker.pyline 13559), with a fallback to the non-query version.display_cal.py: Now checks both str and bytes keys for EDID dict lookups.