Skip to content

馃崚xrandr: always try to update primary

Harald Sitter requested to merge work/cherry-pick-e17c6b5a into Plasma/5.27

When screen0 gets disconnected the atom essentially says it is priority 1 but we ignore it on account of being disconnected/disabled (this happens inside priority()). This caused setPriority to exit early and not do anything. Upon plugging screen0 back in the atom comes into play again and it is still saying the screen is priority 1, but really another screen was/is priority 1. What happens then is that since the atom says the screen is priority1 == newpriority == noop.

tldr:

  • screen0 disconnect: priority=0 == newPrirority=0 -> noop
  • screen1: priority=2 != newPriority=1 -> set_primary
  • screen0 reconnect: priority=1 == newPriority=1 -> noop
  • screen1 is now primary but the entire kscreen system thinks it should be screen0

to solve this problem simply update the primary regardless of the property change, at worst this is noop on the xcb side of things, at best we ensure the primary is in sync

CCBUG: 465396

(cherry picked from commit e17c6b5a)

Merge request reports