Skip to content

Draft: Add connector type to output device protocol

This does not expose the true connector type like HDMI or DP. Instead it abstracts the connector type to an enum with internal, external or unknown. The problem this patch is trying to solve is that, powerdevil needs to know whether an external display is connected, in order to prevent energy saving actions to kick in, if the laptop lid closes.

Other options that I have considered:

  1. Expose the true connector type via a string (HDMI, DP, eDP)
    • (+) This would be more in line with how it works under X11.
    • (-) Comparing strings is tedious and prone to errors.
    • (-) I did not find a use case where someone really needs to know the actual connector type.
  2. Use a bool isInternal instead of an enum
    • (-) There is know way to tell if the compositor really knows it or just defaults to false

The approach to use an enum with internal, external and unknown feels more in line with how things work under Wayland. KWin also already contains code to map a connector type string to internal/external. This logic is duplicated in libkscreen. With this change the code duplication is gone (at least under Wayland)

This is the bug: https://bugs.kde.org/show_bug.cgi?id=438716

Edited by Julius Zint

Merge request reports