【问题标题】:Make Xmonad treat multiple monitors as one让 Xmonad 将多台显示器视为一台显示器
【发布时间】:2018-02-03 22:08:19
【问题描述】:

默认情况下,xmonad 处理every display separately。我可以切换到每个显示器并在其上放置一个工作区。这很好用而且很有意义。

现在我遇到的问题是,通过 DisplayPort 1.2 与 NVidia 显卡连接的 4k 显示器作为两个显示器呈现给系统,每半个显示器一个显示器。我可以用 xrandr 再次将它们放在一起,但 xmonad 仍然将它们视为两个显示器,这意味着我不能将一个窗口放在整个屏幕上(浮动时除外)。

我已经尝试将 xmonad 源中 Operations.hs 中的 rescreen 方法更改为始终返回固定布局而不是系统返回的布局,但这没有任何改变。详情:

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

结果

  [Rectangle {rect_x = 4080, rect_y = 584, rect_width = 1920, rect_height = 2160}, -- D, DP-4.9
   Rectangle {rect_x = 2160, rect_y = 584, rect_width = 1920, rect_height = 2160}, -- C, DP-4.8
   Rectangle {rect_x = 0, rect_y = 1920, rect_width = 2160, rect_height = 1920}, -- B, DP-2.8
   Rectangle {rect_x = 0, rect_y = 0, rect_width = 2160, rect_height = 1920}]    -- A, DP-2.9

这与xrandr报告的布局相对应:

A
   C  D
B

C: DP-4.8 connected primary 1920x2160+4080+584 (normal left inverted right x axis y axis) 527mm x 296mm
D: DP-4.9 connected 1920x2160+2160+584 (normal left inverted right x axis y axis) 527mm x 296mm
B: DP-2.8 connected 2160x1920+0+1920 left (normal left inverted right x axis y axis) 527mm x 296mm
A: DP-2.9 connected 2160x1920+0+0 left (normal left inverted right x axis y axis) 527mm x 296mm

(为了清楚起见,我添加了物理布局)

我尝试为 rescreen 函数提供一个固定的矩形布局,其中每个矩形覆盖显示器的两侧:

myFixed = [Rectangle {rect_x = 2160, rect_y = 584, rect_width = 3840, rect_height = 2160}, -- C, D
         Rectangle {rect_x = 0, rect_y = 0, rect_width = 2160, rect_height = 3840}]    -- A, B

-- | Cleans the list of screens according to the rules documented for
-- nubScreens.
getCleanedScreenInfo :: MonadIO m => Display -> m [Rectangle]
getCleanedScreenInfo = io .  fmap nubScreens . (const $ return myFixed)

但这似乎没有任何改变。

是否有此配置选项?我也很乐意更改源代码,我的布局暂时不会改变。

【问题讨论】:

    标签: xmonad


    【解决方案1】:

    我通过使用一个选项来覆盖 nvidia 驱动程序提供的屏幕信息解决了这个问题,名为TwinViewXineramaInfoOverride。这实现了我通过更改 XMonad 源所尝试的。我的 xorg.conf 中的相关选项是:

     Option "TwinView"
     Option "NoTwinViewXineramaInfo" "0"
     Option "TwinViewXineramaInfoOverride" "2160x3840+0+0, 3840x2160+2160+584"
     # explicitly tell which monitors are connected:
     Option "ConnectedMonitor" "DFP-4.9, DFP-4.8, DFP-2.8, DFP-2.9"
     Option "TwinViewOrientation" "RightOf"
    

    我希望这可以帮助遇到同样问题的人。我仍然不知道这是否可以通过配置 XMonad 来实现,所以我暂时保留这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多