XRandR/X11: 2 つのモニターを 1 つの画面にマージしないでください。

XRandR/X11: 2 つのモニターを 1 つの画面にマージしないでください。

私は最近、GentooからVoid Linuxに切り替えて、モニターが1つしかないシステムにインストールしました。

しかし、今は位置を変えて2つのモニターシステムを使用しています。私のGentooインストールでは、すべてがうまく機能し、X11は2つの画面を互いにマージしてはならず、異なる画面でなければならないことを認識しています。

XRandRの出力は次のようになります。

Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
DisplayPort-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+  50.00    59.94
   1600x1200     60.00
   1680x1050     60.00
   1600x900      60.00
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x800      60.00
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
   720x400       70.08
HDMI-A-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 698mm x 393mm
   1920x1080     60.00*+ 239.96   144.00   120.00   119.88   119.98    50.00    59.94
   1680x1050     60.00
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x800      60.00
   1280x720      60.00    50.00    59.94
   1024x768     119.99    75.03    70.07    60.00
   832x624       74.55
   800x600      119.97    72.19    75.00    60.32    56.25
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.67    60.00    59.94
   720x400       70.08
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
HDMI3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

少なくとも私の考えでは、問題はHDMI-A-0(1920x1080 + 1920 + 0)を拡張することです。 X11がアプリケーションに提供するすべての画面を取得するためにGHCを使用すると、この恐れが確認されます。

コマンド出力

ghc -e "Graphics.X11.openDisplay [] >>= Graphics.X11.Xinerama.getScreenInfo"

次のように:

[Rectangle {rect_x = 0, rect_y = 0, rect_width = 3840, rect_height = 1080}]

明らかに、私が望むのは、X11が1つの長い画面(3840×1080)ではなく2つの画面(それぞれ1920×1080)を提供することです。

次のコマンドを含むオンラインで回答を見つけました。それらのどれも職業を持っていない。

xrandr --output HDMI-A-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --scale 1x1 --size 1920x1080+0+0 \
      --output DisplayPort-0 --mode 1920x1080 --left-of HDMI-A-0 --rotate normal --scale 1x1 --size 1920x1080+0+0 ;
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0 --pos 1920x0
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0 --pos 0x0
xrandr --output DisplayPort-0 --auto --mode 1920x1080 --left-of HDMI-A-0

など..

ご協力ありがとうございます

ベストアンサー1

一つの理由は、「あなたのHaskellX11ライブラリXinerama用に作られていません。」

次のチェックを実行する必要があります。今後調査するopenDisplay "" >>= getScreenInfo

ghc -e Graphics.X11.Xinerama.compiledWithXinerama

https://wiki.haskell.org/Xmonad/Frequently_asked_questions#Multi_head_or_xinerama_troubles


NixOSでスタックでXmonadを使用すると、この問題が発生し、stack.yaml次のファイルで解決しました。

resolver: lts-19.33
packages:
  - .
nix:
  enable: true
  packages:
    - xorg.libX11
    - xorg.libXinerama # <-- important for multi-display support
    - xorg.libXext
    - xorg.libXft
    - xorg.libXrandr
    - xorg.libXScrnSaver
    - pkg-config

X11ライブラリを強制的に再構築する必要があることに注意してください(たとえば、rm -rf ~/.stack非常に粗雑な方法で)。

おすすめ記事