Fix moving Emacs frames

* exwm.el (exwm--on-ClientMessage): Avoid moving workspace frames;
Move floating X window when trying to move the floating frame.
This commit is contained in:
Chris Feng 2019-12-15 00:00:00 +00:00
parent 8b05c2a30d
commit 65ec749bb0

28
exwm.el
View file

@ -479,7 +479,33 @@
) )
((= direction xcb:ewmh:_NET_WM_MOVERESIZE_CANCEL) ((= direction xcb:ewmh:_NET_WM_MOVERESIZE_CANCEL)
(exwm-floating--stop-moveresize)) (exwm-floating--stop-moveresize))
(t (exwm-floating--start-moveresize id direction)))))) ;; In case it's a workspace frame.
((and (not buffer)
(catch 'break
(dolist (f exwm-workspace--list)
(when (or (eq id (frame-parameter f 'exwm-outer-id))
(eq id (frame-parameter f 'exwm-id)))
(throw 'break t)))
nil)))
(t
;; In case it's a floating frame,
;; move the corresponding X window instead.
(unless buffer
(catch 'break
(dolist (pair exwm--id-buffer-alist)
(with-current-buffer (cdr pair)
(when
(and exwm--floating-frame
(or (eq id
(frame-parameter exwm--floating-frame
'exwm-outer-id))
(eq id
(frame-parameter exwm--floating-frame
'exwm-id))))
(setq id exwm--id)
(throw 'break nil))))))
;; Start to move it.
(exwm-floating--start-moveresize id direction))))))
;; _NET_REQUEST_FRAME_EXTENTS ;; _NET_REQUEST_FRAME_EXTENTS
((= type xcb:Atom:_NET_REQUEST_FRAME_EXTENTS) ((= type xcb:Atom:_NET_REQUEST_FRAME_EXTENTS)
(let ((buffer (exwm--id->buffer id)) (let ((buffer (exwm--id->buffer id))