emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm 5f9f673 47/64: Fix window size calculations


From: Chris Feng
Subject: [elpa] externals/exwm 5f9f673 47/64: Fix window size calculations
Date: Thu, 17 Sep 2015 23:18:07 +0000

branch: externals/exwm
commit 5f9f6737912f2a18f7adfff8c6f3ef8162ca52f1
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    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 +++++----
 exwm-manage.el   |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/exwm-floating.el b/exwm-floating.el
index 8c2a8f49..0b4f327 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))
diff --git a/exwm-manage.el b/exwm-manage.el
index 0fde4d4..e7134fe 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -289,7 +289,7 @@ corresponding buffer.")
                             (frame-pixel-height exwm-workspace--current))
                     (or exwm--floating-edges
                         (window-inside-absolute-pixel-edges
-                         (get-buffer-window)))))
+                         (get-buffer-window buffer t)))))
             (exwm--log "Reply with ConfigureNotify (edges): %s" edges)
             (xcb:+request exwm--connection
                 (make-instance 'xcb:SendEvent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]