Conversation
6c8d3e5 to
439fb11
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds enhanced monitor detail support to the XCB (X11) backend on Linux, introducing optional fields for monitor metadata including human-readable names, unique identifiers, primary monitor indication, and output names. The implementation leverages XRandR 1.5+ monitors when available, with a fallback to CRTC enumeration for older servers.
Changes:
- Added EDID parsing functionality to extract monitor metadata (model names, serial numbers, manufacturing information)
- Implemented atom interning and caching mechanism for efficient X11 property lookups
- Extended monitor detection to use XRandR GetMonitors (v1.5+) and GetOutputInfo APIs
- Generated Python bindings for additional XRandR protocol requests
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/xcbproto/gen_xcb_to_py.py |
Added XRandR requests (GetOutputInfo, GetOutputPrimary, GetOutputProperty, GetMonitors) to code generator configuration with improved comment explaining InternAtom special handling |
src/xcbproto/README.md |
Updated maintainer workflow documentation to include ruff formatting step (contains spelling error) |
src/mss/tools.py |
Implemented parse_edid() function to extract monitor identification data from EDID blocks (has off-by-one error and padding issue) |
src/mss/linux/xcbhelpers.py |
Added InternAtomReply structure and initialization for xcb_intern_atom function |
src/mss/linux/xcbgen.py |
Generated Python bindings for new XRandR structures and requests, including formatting improvements |
src/mss/linux/xcb.py |
Implemented intern_atom() with predefined atom table and per-connection caching (has critical cache bug and unused imports) |
src/mss/linux/base.py |
Refactored monitor detection to support RandR 1.5+ monitors and CRTC-based fallback, extracting EDID data and output information |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7e373a3 to
5ea0d90
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1c6f00c to
ba1adf3
Compare
Otherwise, you need things like `this_visual_id.value == that_visual_id.value`, and get unexpected negatives for just `this_visual_id == that_visual_id`. This can be a potential source of bugs.
This will be needed to get the monitor's human-friendly name under Linux: XRandR will give us the EDID block, but we need to parse it.
See BoboTiG/python-mss PR BoboTiG#469 and issue BoboTiG#153. There are no plans to add similar code to the legacy Xlib backend.
ba1adf3 to
861926a
Compare
This is a placeholder PR to let the AI review the branch before I send it upstream.
This is adding support for monitor detail to the XCB backends. We've decided to add several optional fields to the monitors dicts:
name(human-readable name, if available),unique_id(a platform-specific opaque string that identifies the monitor as best as possible across configuration changes),is_primary(for the primary monitor, where things like the taskbar live), andoutput(Linux only, included since that's how users interact with some monitor configuration tools, like the xrandr command-line tool).The Sphinx docs, and the other platforms, are being updated in a separate branch. Xlib is a legacy backend and won't be updated.