mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-30 14:38:00 +01:00
Allow floating X windows to resize themselves
* exwm-manage.el (exwm-manage--on-ConfigureRequest): Allow (non-fullscreen) floating X windows to resize themselves.
This commit is contained in:
parent
6fe6fe52f6
commit
f0a5425f4c
1 changed files with 26 additions and 11 deletions
|
@ -419,7 +419,9 @@ Would you like to kill it? "
|
||||||
border-width: %d; sibling: #x%x; stack-mode: %d"
|
border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
window value-mask width height x y
|
window value-mask width height x y
|
||||||
border-width sibling stack-mode)
|
border-width sibling stack-mode)
|
||||||
(if (setq buffer (exwm--id->buffer window))
|
(if (and (setq buffer (exwm--id->buffer window))
|
||||||
|
(with-current-buffer buffer
|
||||||
|
(or exwm--fullscreen (not exwm--floating-frame))))
|
||||||
;; Send client message for managed windows
|
;; Send client message for managed windows
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(setq edges
|
(setq edges
|
||||||
|
@ -444,16 +446,29 @@ border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
:height (- (elt edges 3) (elt edges 1))
|
:height (- (elt edges 3) (elt edges 1))
|
||||||
:border-width 0 :override-redirect 0)
|
:border-width 0 :override-redirect 0)
|
||||||
exwm--connection))))
|
exwm--connection))))
|
||||||
(exwm--log "ConfigureWindow (preserve geometry)")
|
(if buffer
|
||||||
;; Configure the unmanaged window.
|
(with-current-buffer buffer
|
||||||
(xcb:+request exwm--connection
|
(exwm--log "ConfigureWindow (resize floating X window)")
|
||||||
(make-instance 'xcb:ConfigureWindow
|
(setq edges
|
||||||
:window window
|
(window-inside-pixel-edges (get-buffer-window buffer t)))
|
||||||
:value-mask value-mask
|
(set-frame-size exwm--floating-frame
|
||||||
:x x :y y :width width :height height
|
(+ width
|
||||||
:border-width border-width
|
(- (frame-pixel-width exwm--floating-frame)
|
||||||
:sibling sibling
|
(- (elt edges 2) (elt edges 0))))
|
||||||
:stack-mode stack-mode)))))
|
(+ height
|
||||||
|
(- (frame-pixel-height exwm--floating-frame)
|
||||||
|
(- (elt edges 3) (elt edges 1))))
|
||||||
|
t))
|
||||||
|
(exwm--log "ConfigureWindow (preserve geometry)")
|
||||||
|
;; Configure the unmanaged window.
|
||||||
|
(xcb:+request exwm--connection
|
||||||
|
(make-instance 'xcb:ConfigureWindow
|
||||||
|
:window window
|
||||||
|
:value-mask value-mask
|
||||||
|
:x x :y y :width width :height height
|
||||||
|
:border-width border-width
|
||||||
|
:sibling sibling
|
||||||
|
:stack-mode stack-mode))))))
|
||||||
(xcb:flush exwm--connection))
|
(xcb:flush exwm--connection))
|
||||||
|
|
||||||
(defun exwm-manage--on-MapRequest (data _synthetic)
|
(defun exwm-manage--on-MapRequest (data _synthetic)
|
||||||
|
|
Loading…
Reference in a new issue