1

I am currently working on a multi window application that spans over multiple screens. The software is written with xlib and runs on ubuntu 10.10, gnome desktop. To get the position of every window I'd like to access the /etc/X11/xorg.conf file, expecially the section SeverLayout. It looks somehow like this:

Section "ServerLayout"
     Identifier "aticonfig Layout"
     Screen     "screen0" 0 0
     Screen     "screen1" 1920 0
     Screen     "screen2" 3840 0
     Screen     "screen3" 5760 0
EndSection

I'd like to get the X values of each screen (0, 1920, ... ) Does xlib somehow provide access to this information?

thanks

4

2 回答 2

0

通过libXrandrlibXinerama API可以获得有关 X 中多个监视器的布局信息,尤其是当它们组合成一个逻辑屏幕时。不幸的是,1.2 版中添加到 libXrandr 的多屏 API 并未包含在手册页中,但需要查看扩展规范Xrandr.h 头文件

于 2011-02-23T02:23:57.387 回答
0

您可以使用 XWidthOfScreen 和 XHeightOfScreen 函数。

使用 XScreenCount(获取屏幕数量)和 XScreenOfDisplay 获取适当的屏幕结构。

更好的方法是获取屏幕的根窗口并使用 XParseGeometry 函数解析它的几何图形。

于 2011-02-22T15:17:08.380 回答