[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 2597f74 3/4: Remember the geometries of floating X
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 2597f74 3/4: Remember the geometries of floating X windows |
Date: |
Fri, 23 Sep 2016 10:54:46 +0000 (UTC) |
branch: externals/exwm
commit 2597f74c7fb9ad290a45c89d0025bebcf739a976
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Remember the geometries of floating X windows
* exwm-floating.el (exwm-floating--stop-moveresize):
* exwm-layout.el (exwm-layout-enlarge-window):
Update the geometry after resizing.
---
exwm-floating.el | 31 ++++++++++++++++++++++---------
exwm-layout.el | 2 ++
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/exwm-floating.el b/exwm-floating.el
index f2cc09b..5b8cc89 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -550,22 +550,35 @@ context of the corresponding buffer.")
;; Unmanaged.
(eq major-mode 'exwm-mode))
(let ((edges (window-inside-absolute-pixel-edges (frame-selected-window)))
- (id (buffer-local-value 'exwm--id
- (window-buffer (frame-selected-window)))))
+ x y width height id)
+ (setq x (pop edges)
+ y (pop edges)
+ width (- (pop edges) x)
+ height (- (pop edges) y))
+ (with-current-buffer (window-buffer (frame-selected-window))
+ (setq id exwm--id)
+ (with-slots ((x* x)
+ (y* y)
+ (width* width)
+ (height* height))
+ exwm--geometry
+ (setf x* x
+ y* y
+ width* width
+ height* height)))
(xcb:+request exwm--connection
(make-instance 'xcb:SendEvent
- :propagate 0 :destination id
+ :propagate 0
+ :destination id
:event-mask xcb:EventMask:StructureNotify
:event (xcb:marshal
(make-instance 'xcb:ConfigureNotify
:event id :window id
:above-sibling xcb:Window:None
- :x (elt edges 0)
- :y (elt edges 1)
- :width (- (elt edges 2)
- (elt edges 0))
- :height (- (elt edges 3)
- (elt edges 1))
+ :x x
+ :y y
+ :width width
+ :height height
:border-width 0
:override-redirect 0)
exwm--connection)))))
diff --git a/exwm-layout.el b/exwm-layout.el
index 355b834..5a31c94 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -460,6 +460,7 @@ windows."
(setq width (max (+ exwm--normal-hints-min-width margin)
(+ width delta))))))
(when width
+ (setf (slot-value exwm--geometry 'width) width)
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window (frame-parameter exwm--floating-frame
@@ -492,6 +493,7 @@ windows."
(setq height (max (+ exwm--normal-hints-min-height margin)
(+ height delta))))))
(when height
+ (setf (slot-value exwm--geometry 'height) height)
(xcb:+request exwm--connection
(make-instance 'xcb:ConfigureWindow
:window (frame-parameter exwm--floating-frame