Night Light only affects one of two identical external monitors with identical EDIDs

Open Beginner friendly
#482 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c
Domain
desktop

Research direction

Start in plugins/color/csd-color-state.c and read ccm_session_get_output_id() alongside ccm_session_get_state_output_by_id(). Check how the device ID is formed for outputs with duplicate EDID data, then build and verify that two identical monitors on different XRandR outputs receive separate IDs and both respond to Night Light.

Written by the indexing model from the issue text.

Description

I found and fixed a bug in cinnamon-settings-daemon affecting systems with two identical external monitors.

System:

Linux Mint 22.3 Zena

Cinnamon 6.6.9

cinnamon-settings-daemon 6.6.4+zena

X11 session

Intel Iris Xe graphics

Two identical HKC E2411F monitors connected via DisplayPort

Problem

Both external monitors have identical EDID data, including the same manufacturer, model and serial number.

When Night Light was enabled, only one of the two external monitors changed its color temperature. The second monitor was not affected.

Root cause

In plugins/color/csd-color-state.c, the function ccm_session_get_output_id() creates the device ID using the EDID vendor, model and serial number.

For two identical monitors, this produces the same device ID.

The function ccm_session_get_state_output_by_id() then returns the first output matching that ID. Consequently, both physical monitors are mapped to the same output.

Colord originally showed only one external display device.

Proposed fix

Append the XRandR output name to the device ID, even when valid EDID data is available:

/* Distinguish identical monitors connected to different outputs. */
g_string_append_printf (device_id,
"-%s",
gnome_rr_output_get_name (output));

This makes the IDs unique for monitors connected to different outputs.

Verification

I applied this change locally, rebuilt and installed cinnamon-settings-daemon, and rebooted.

After the change, colormgr get-devices correctly showed two separate display devices:

...DP-2-1

...DP-2-2

Both monitors were then affected correctly by Cinnamon Night Light, including after a reboot.

Expected behavior

Each physical display should have its own unique device ID, even if multiple monitors report identical EDID data.

I hope this fix can be considered for inclusion in Cinnamon.

Dominant language
C
Stars
70
Forks
81
Avg merge
2d 7h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxmint/cinnamon-settings-daemon

All issues in linuxmint/cinnamon-settings-daemon

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.