mirror of
https://github.com/emacs-exwm/exwm.git
synced 2024-11-30 16:07:59 +01:00
Fix 2 dock-related issues
* exwm-floating.el (exwm-floating--set-floating): Add a workaround to prevent accidental move of Emacs frame when struts are set. * exwm-workspace.el (exwm-workspace--update-workareas): Make legacy docks working.
This commit is contained in:
parent
1a716d3939
commit
c22f35620f
2 changed files with 29 additions and 13 deletions
|
@ -70,6 +70,7 @@
|
||||||
(defvar exwm-workspace--list)
|
(defvar exwm-workspace--list)
|
||||||
(defvar exwm-workspace-current-index)
|
(defvar exwm-workspace-current-index)
|
||||||
(defvar exwm-workspace--switch-history-outdated)
|
(defvar exwm-workspace--switch-history-outdated)
|
||||||
|
(defvar exwm-workspace--struts)
|
||||||
|
|
||||||
(declare-function exwm-layout--refresh "exwm-layout.el" ())
|
(declare-function exwm-layout--refresh "exwm-layout.el" ())
|
||||||
(declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
|
(declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
|
||||||
|
@ -242,7 +243,18 @@
|
||||||
(exwm-floating-hide))
|
(exwm-floating-hide))
|
||||||
(with-selected-frame exwm-workspace--current
|
(with-selected-frame exwm-workspace--current
|
||||||
(exwm-layout--refresh))
|
(exwm-layout--refresh))
|
||||||
(select-frame-set-input-focus frame)))
|
(select-frame-set-input-focus frame))
|
||||||
|
;; FIXME: Strangely, the Emacs frame can move itself at this point
|
||||||
|
;; when there are left/top struts set. Force resetting its
|
||||||
|
;; position seems working, but it'd better to figure out why.
|
||||||
|
(when exwm-workspace--struts
|
||||||
|
(xcb:+request exwm--connection
|
||||||
|
(make-instance 'xcb:ConfigureWindow
|
||||||
|
:window outer-id
|
||||||
|
:value-mask (logior xcb:ConfigWindow:X
|
||||||
|
xcb:ConfigWindow:Y)
|
||||||
|
:x 0 :y 0))
|
||||||
|
(xcb:flush exwm--connection)))
|
||||||
(run-hooks 'exwm-floating-setup-hook)
|
(run-hooks 'exwm-floating-setup-hook)
|
||||||
;; Redraw the frame.
|
;; Redraw the frame.
|
||||||
(redisplay))
|
(redisplay))
|
||||||
|
|
|
@ -191,32 +191,36 @@ Value nil means to use the default position which is fixed at bottom, while
|
||||||
(`left
|
(`left
|
||||||
(setq delta (- (aref w 0) width))
|
(setq delta (- (aref w 0) width))
|
||||||
(when (and (< delta 0)
|
(when (and (< delta 0)
|
||||||
|
(or (not position)
|
||||||
(< (max (aref position 0) (aref w 1))
|
(< (max (aref position 0) (aref w 1))
|
||||||
(min (aref position 1)
|
(min (aref position 1)
|
||||||
(+ (aref w 1) (aref w 3)))))
|
(+ (aref w 1) (aref w 3))))))
|
||||||
(cl-incf (aref w 2) delta)
|
(cl-incf (aref w 2) delta)
|
||||||
(setf (aref w 0) width)))
|
(setf (aref w 0) width)))
|
||||||
(`right
|
(`right
|
||||||
(setq delta (- root-width (aref w 0) (aref w 2) width))
|
(setq delta (- root-width (aref w 0) (aref w 2) width))
|
||||||
(when (and (< delta 0)
|
(when (and (< delta 0)
|
||||||
|
(or (not position)
|
||||||
(< (max (aref position 0) (aref w 1))
|
(< (max (aref position 0) (aref w 1))
|
||||||
(min (aref position 1)
|
(min (aref position 1)
|
||||||
(+ (aref w 1) (aref w 3)))))
|
(+ (aref w 1) (aref w 3))))))
|
||||||
(cl-incf (aref w 2) delta)))
|
(cl-incf (aref w 2) delta)))
|
||||||
(`top
|
(`top
|
||||||
(setq delta (- (aref w 1) width))
|
(setq delta (- (aref w 1) width))
|
||||||
(when (and (< delta 0)
|
(when (and (< delta 0)
|
||||||
|
(or (not position)
|
||||||
(< (max (aref position 0) (aref w 0))
|
(< (max (aref position 0) (aref w 0))
|
||||||
(min (aref position 1)
|
(min (aref position 1)
|
||||||
(+ (aref w 0) (aref w 2)))))
|
(+ (aref w 0) (aref w 2))))))
|
||||||
(cl-incf (aref w 3) delta)
|
(cl-incf (aref w 3) delta)
|
||||||
(setf (aref w 1) width)))
|
(setf (aref w 1) width)))
|
||||||
(`bottom
|
(`bottom
|
||||||
(setq delta (- root-height (aref w 1) (aref w 3) width))
|
(setq delta (- root-height (aref w 1) (aref w 3) width))
|
||||||
(when (and (< delta 0)
|
(when (and (< delta 0)
|
||||||
|
(or (not position)
|
||||||
(< (max (aref position 0) (aref w 0))
|
(< (max (aref position 0) (aref w 0))
|
||||||
(min (aref position 1)
|
(min (aref position 1)
|
||||||
(+ (aref w 0) (aref w 2)))))
|
(+ (aref w 0) (aref w 2))))))
|
||||||
(cl-incf (aref w 3) delta))))))
|
(cl-incf (aref w 3) delta))))))
|
||||||
;; Save the result.
|
;; Save the result.
|
||||||
(setq exwm-workspace--workareas workareas)
|
(setq exwm-workspace--workareas workareas)
|
||||||
|
|
Loading…
Reference in a new issue