4

By default, xmonad treats every display separately. I can switch to each display and put a workspace on it. This works great and makes sense.

Now I have the problem that a 4k display connected over DisplayPort 1.2 with a NVidia graphics card is presented as two displays to the system, one display for every half of the monitor. I can put them together again with xrandr, but xmonad still treats them as two displays, which means I can't put one window over the whole screen (except when floating).

I already tried to change the rescreen method in Operations.hs in the xmonad source to always return a fixed layout instead the layout returned by the system, but this changed nothing. Details:

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

restults in

  [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

Which corresponds with the layout reported by 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

(I added the physical layout for clarity)

I tried to give the rescreen function a fixed rectangle layout where each rectangle covers both sides of a display:

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)

But that seemed to change nothing.

Is there a configuration option for this? I would also be happy to change the source code, my layout won't change for a while.

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
Sven Koschnicke
  • 6,523
  • 2
  • 34
  • 49

1 Answers1

3

I solved the problem by using an option to override the screen information provided by the nvidia driver, named TwinViewXineramaInfoOverride. This achieves what I tried by changing the XMonad source. The relevant options in my xorg.conf are:

 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"

I hope this helps someone with the same problem. I still don't know if this is possible by configuring XMonad so I leave this question open for now.

Sven Koschnicke
  • 6,523
  • 2
  • 34
  • 49