Elf M. Sternberg
2cd9b268a8
reliable as a source of truth about which monitors and screens are actually in use. Each one comes with its own collection of `crtc`, but you can just skip the ones that return `null`, giving you a reliable list of the "active and visible" screens that the user is currently looking at. Excellent! This means that I'm one step closer to having a viable solution! I also discovered the [xcb_util](https://xcb.freedesktop.org/XcbUtil/) library of helpful utilities has a function called `xcb_aux_get_screen` for getting the root screen because everyone was weirded out by that list traversal algorithm. The source code to [xedgewarp](https://github.com/Airblader/xedgewarp) was invaluable in revealing these secrets to me. So far this little toy compiles down to only 35KB, and that includes using `std::cout` and `std::vector`! I wonder how big the Rust version will be. Yeah, yeah, I know, it cheats by having lots of itself hidden in the kernel. Next up: Actually knowing what the rotation status is. |
||
---|---|---|
docs | ||
src | ||
studies | ||
.clang-format | ||
.gitignore | ||
CMakeLists.txt | ||
LICENSE | ||
Makefile | ||
README.md | ||
notes.md |
README.md
WHAT:
This is an attempt to write a simple iteration of XRandR using XCB and C++.
WHY:
I'm not familiar enough with this ecosystem to be useful in it, and I need to start getting some familiarity with it before I start hacking a Rust project that needs XCB/XRandR capability.
REQURIEMENTS:
This code has been tested with gcc-7.3, and should work on any C++17-compliant compiler with the relevant standard library, and obviously X Windows.
STATUS:
In progress.
DETAILS:
Notes:
BUILDING:
From the base directory of the project:
mkdir build
cd build
cmake ..
make