Added showing the Output name along with the details (if any).
This commit is contained in:
parent
f60e935ffe
commit
0af01c5e0d
|
@ -40,5 +40,15 @@ And the following facts:
|
|||
Work](https://www.x.org/wiki/Development/Documentation/HowVideoCardsWork/)... [TK]
|
||||
- An output can have multiple CRTCs... but usually has only one.
|
||||
|
||||
Unresolved questions ...
|
||||
|
||||
- If the output encapsulates the _whole_ of screen (and the root window), when
|
||||
we rotate the output who does coordinate remapping? I believe that's the
|
||||
responsibility of the window manager. But if that's true, then what are the
|
||||
implications for image viewers?
|
||||
|
||||
- If the output encapsulates only a subwindow of the whole, what is the
|
||||
responsibility of the window manager when the new dimensions fit easily within
|
||||
the screen as a whole?
|
||||
|
||||
|
||||
|
|
|
@ -33,9 +33,20 @@ void display_one_output(xcb_connection_t* connection, xcb_randr_get_output_info_
|
|||
xcb_timestamp_t timestamp) {
|
||||
xcb_randr_get_crtc_info_reply_t* crtc = xcb_randr_get_crtc_info_reply(
|
||||
connection, xcb_randr_get_crtc_info(connection, output->crtc, timestamp), NULL);
|
||||
|
||||
// Note: This is part of the output structure natively; it's just not
|
||||
// automagically exposed. (Opaque structures suck.) But it's both accessible
|
||||
// and null-terminated, so it's relatively safe to use this way, and it does
|
||||
// not require free() at the end.
|
||||
auto name = xcb_randr_get_output_info_name(output);
|
||||
if (name) {
|
||||
std::cout << "DISPLAY: " << name << std::endl;
|
||||
}
|
||||
|
||||
if (!crtc) {
|
||||
return;
|
||||
}
|
||||
|
||||
display_one_crtc(crtc);
|
||||
free(crtc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue