Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11: Add support for get_monitors() (#1804)
* x11: Add support for get_monitors() Like everything X11, getting the list of monitors is complicated. X11 has a concept of "screen" in the core protocol. This is not really used these days, because it is not possible to move windows between screens, but that is the common fallback. Then came the Xinerama extension. Let's ignore that here... Next up is the RandR extension. It allows to query information about the actually connected hardware and its configuration via a GetScreenResources request. Since asking the hardware about its state is sometimes slow, GetScreenResourcesCurrent was later added, which does not ask the hardware, but only provides the newest information that is available to the X11 server. Next came high resolution displays with resolution so high that they needed to be connected with two cables. These display appear as two CRTCs, which is a problem. We don't want applications to think your display is actually two displays. However, RandR provided way too much information about CRTCs and stuff and it was not easy to just hide this all. Thus, RandR monitors were added and a monitor can consist of more than one CRTC and everything is fine. Thanks to the above, there are lots of special cases here. I only tested the RandR monitor case in this commit. Signed-off-by: Uli Schlachter <[email protected]> * Apply rustfmt's suggestion Signed-off-by: Uli Schlachter <[email protected]> * Silence a clippy warning Signed-off-by: Uli Schlachter <[email protected]> * rustfmt had more complaints... Signed-off-by: Uli Schlachter <[email protected]> * Update druid-shell/src/platform/x11/screen.rs Re-use existing App instance, as suggested by @maan2003 Co-authored-by: Manmeet Maan <[email protected]> * Ignore CRTCs with width/height = 0 Signed-off-by: Uli Schlachter <[email protected]> Co-authored-by: Manmeet Maan <[email protected]> Co-authored-by: jneem <[email protected]>
- Loading branch information