ch11ng / exwm

Emacs X Window Manager
2.85k stars 134 forks source link

Multi-screen support stopped working in exwm-21 #562

Closed map7 closed 5 years ago

map7 commented 5 years ago

I'm using exwm-0.20 and recently upgraded to 0.22.1 which broke my multi-screen setup. I tried 0.21 and it was still failing and I had to revert back to 0.20 for my configuration to work again.

I'm using xrandr 1.4.2 under Debian 8 64bit with a compiled version of emacs stable 26.1.91.

I've tried this minimum configuration to try and get it to work

(package-initialize)
(require 'package)
(setq package-enable-at-startup nil)   ;; To prevent initialising twice
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
                         ("marmalade" . "https://marmalade-repo.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "https://orgmode.org/elpa/")))

(require 'exwm)
(require 'exwm-config)

(require 'exwm-randr)
(setq exwm-randr-workspace-output-plist '(0 "HDMI2" 1 "HDMI3" 2 "HDMI2" 3 "DP1" 4 "HDMI3" 5 "DP1" 6 "HDMI3" 7 "DP1"))
(add-hook 'exwm-randr-screen-change-hook
      (lambda ()
        (start-process-shell-command
         "xrandr" nil "xrandr --output DP1 --right-of HDMI2 --output HDMI2 --auto --output HDMI3 --left-of HDMI2 --output HDMI3 --auto")))
(exwm-randr-enable)

(exwm-config-default)

The problem is it spans the buffer across all three monitors instead of proper multi-screen support. It also disables the use of my keyboard but I can still click around. I can use the keyboard to get back to VT1 and kill emacs. If I remark out the exwm-randr lines then the keyboard works fine.

I think it might be an issue with how the xrandr commands are used in exwm.

Ie; I don't have the listactivemonitors switch

xrandr --listactivemonitors
xrandr: unrecognized option '--listactivemonitors'
Try 'xrandr --help' for more information.
ch11ng commented 5 years ago

On Debian the 1.5 version of xrandr is packaged in x11-xserver-utils since 7.7+6, but the utility itself has little to do with this problem. According to the report it seems the X server shipped with Debian 8 has no RandR 1.5 support. If this is the case, we can bring back the support for RandR 1.3. Could you check with the following snippet (it should return (1 5))?

(with-slots (major-version minor-version)
    (xcb:+request-unchecked+reply exwm--connection
        (make-instance 'xcb:randr:QueryVersion
                       :major-version 1
                       :minor-version 5))
  (list major-version minor-version))
map7 commented 5 years ago

It returns 1.4

ch11ng commented 5 years ago

Please check out f70bdb5868fc098b7f1f44e6eced3819eb13ea42 and see if it works.

map7 commented 5 years ago

It works! thank you so much. I know I'm on an old system but it's great it's now supported.