python-xlib - how to deterministically tell whether display output is in extending or mirroring mode
Asked Answered
H

1

1

It's not clear to me from the documentation
http://python-xlib.sourceforge.net/doc/html/python-xlib_toc.html

how I could deterministically check whether a given display output (eg: HDMI-1) is extending or mirroring other display output.

the get_output_info method in the example bellow does not contain any information from which I could derive that.

from Xlib import X, display, Xutil
from Xlib.ext import randr

d = display.Display()
    root = d.screen().root
    resources = root.xrandr_get_screen_resources()._data
    outputs = []

    for output in resources['outputs']:
        _data = d.xrandr_get_output_info(output,
                resources['config_timestamp'])._data
  1. Is it possible?
  2. if so, how please?

Thank you!

Hanker answered 6/3, 2018 at 17:26 Comment(0)
H
1

With the following you can get x,y coordinates of framebuffer of a crtc of given output (from which you can derive whether given output is cloned or extended):

        crtcInfo = d.xrandr_get_crtc_info(_data['crtc'],
            resources['config_timestamp'])
        x = crtcInfo.x
        y = crtcInfo.y

The following helped me to understand the problem: https://www.x.org/wiki/Development/Documentation/HowVideoCardsWork/#index3h3

Hanker answered 8/3, 2018 at 11:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.