How to query X11 display resolution?

前端 未结 7 871
一整个雨季
一整个雨季 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 10:16

    Check out display macros and screen macros from the Xlib manual.

    Specifically:

    • From the first link: ScreenCount(), ScreenOfDisplay()
    • From the second link: WidthOfScreen(), HeightOfScreen()

提交回复
热议问题