How to query X11 display resolution?

前端 未结 7 870
一整个雨季
一整个雨季 2021-02-05 09:24

It seems like an simple problem, but I can\'t find the answer: How do you query (via X11) what monitors exist and their resolutions?

7条回答
  •  青春惊慌失措
    2021-02-05 09:57

    If Xinerama is in use, try XineramaQueryScreens. Otherwise, you may be able to assume a single screen and use (X)WidthOfScreen/(X)HeightOfScreen.

    (Also see the other answer. It's remotely possible someone is using the old X screen model where your screens are :x.0, :x.1, etc.)

提交回复
热议问题