From 07e59e0429c4b13a5036e9a207e37fc02135f599 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Thu, 13 Aug 2015 12:02:44 +0800 Subject: Fix multi-screen bugs * RandR module is now made optional; users can enable it with `exwm-randr-enable`. * Correct the calculation of sizes/coordinates at various places. * Input focus is now tracked with (Emacs) window instead of buffer since the latter can be ambiguous in multi-screen settings. --- exwm-layout.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'exwm-layout.el') diff --git a/exwm-layout.el b/exwm-layout.el index f2d4eb0cbe..a6b450f7da 100644 --- a/exwm-layout.el +++ b/exwm-layout.el @@ -111,8 +111,9 @@ xcb:ConfigWindow:Width xcb:ConfigWindow:Height) :x 0 :y 0 - :width (x-display-pixel-width) - :height (x-display-pixel-height)))) + :width (frame-pixel-width exwm-workspace--current) + :height (frame-pixel-height + exwm-workspace--current)))) (xcb:flush exwm--connection)) (xcb:+request exwm--connection (make-instance 'xcb:ConfigureWindow @@ -122,8 +123,8 @@ xcb:ConfigWindow:Width xcb:ConfigWindow:Height) :x 0 :y 0 - :width (x-display-pixel-width) - :height (x-display-pixel-height))) + :width (frame-pixel-width exwm-workspace--current) + :height (frame-pixel-height exwm-workspace--current))) (xcb:+request exwm--connection (make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id @@ -168,11 +169,11 @@ (if (frame-parameter frame 'exwm-window-id) ;; Refresh a floating frame (progn - (cl-assert (eq major-mode 'exwm-mode)) - (let ((window (frame-first-window frame))) - (with-current-buffer (window-buffer window) - (exwm--log "Refresh floating window #x%x" exwm--id) - (exwm-layout--show exwm--id window)))) + (when (eq major-mode 'exwm-mode) + (let ((window (frame-first-window frame))) + (with-current-buffer (window-buffer window) + (exwm--log "Refresh floating window #x%x" exwm--id) + (exwm-layout--show exwm--id window))))) ;; Other frames (e.g. terminal/graphical frame of emacsclient) ;; We shall bury all `exwm-mode' buffers in this case (unless placeholder ;create the *scratch* buffer if it's killed -- cgit 1.4.1