From 5f9f6737912f2a18f7adfff8c6f3ef8162ca52f1 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Thu, 27 Aug 2015 11:03:27 +0800 Subject: Fix window size calculations * When sending the synthetic ConfigureNotify event, make sure we are dealing with the correct Emacs window * When managing a floating window, ensure it can be easily pick up by the user --- exwm-floating.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'exwm-floating.el') diff --git a/exwm-floating.el b/exwm-floating.el index 8c2a8f4998d9..0b4f327f8b71 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -98,8 +98,8 @@ width display-width)) ;; Invalid width (when (= 0 width) (setq width (/ display-width 2))) - ;; Completely outsize - (when (or (> x display-width) (> 0 (+ x display-width))) + ;; Make sure at least half of the window is visible + (when (or (> (+ x (/ width 2)) display-width) (> 0 (+ x (/ width 2)))) (setq x (/ (- display-width width) 2)))) (if (> height display-height) ;; Too tall @@ -107,8 +107,9 @@ height display-height) ;; Invalid height (when (= 0 height) (setq height (/ display-height 2))) - ;; Completely outside - (when (or (> y display-height) (> 0 (+ y display-height))) + ;; Make sure at least half of the window is visible + (when (or (> (+ y (/ height 2)) display-height) + (> 0 (+ y (/ height 2)))) (setq y (/ (- display-height height) 2)))) ;; Center floating windows (when (and (= x 0) (= y 0)) -- cgit 1.4.1