The stages of me learning XCB, both in C++ and Rust. There are a couple of side lessons (CMake and vendoring) that are as aside to the whole story, but they're at least important to preserve.
Go to file
Elf M. Sternberg 2cd9b268a8 Innteresting. It seems that the `output` collection is much more
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.
2022-02-24 15:59:43 -08:00
docs Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
src Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
studies Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
.clang-format Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
.gitignore Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
CMakeLists.txt Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
LICENSE Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
Makefile Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
README.md Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00
notes.md Innteresting. It seems that the `output` collection is much more 2022-02-24 15:59:43 -08:00

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