2015-03-25 66 views
4

默認情況下,xmonad將視爲every display separately。我可以切換到每個顯示器並在其上放置一個工作區。這工作很好,很有意義。製作Xmonad將多臺顯示器視爲一臺

現在我遇到了一個問題,即通過DisplayPort 1.2連接NVidia圖形卡的4k顯示器作爲兩個顯示器呈現給系統,一個顯示器顯示每半個顯示器。我可以將它們與xrandr再次放在一起,但xmonad仍將它們視爲兩個顯示,這意味着我無法在整個屏幕上放置一個窗口(除非浮動)。

我已經嘗試在xmonad源代碼中更改rescreen方法Operations.hs,以始終返回一個固定的佈局,而不是由系統返回的佈局,但這沒有任何改變。詳細信息:

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

restults在

[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) 

但這似乎沒有改變。

是否有配置選項?我也很樂意改變源代碼,我的佈局不會改變一段時間。

回答

3

我通過使用一個選項覆蓋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是否可行,所以我現在就把這個問題留下來。