From 65ec749bb074b51824576834d1f85c3c4301e999 Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Sun, 15 Dec 2019 00:00:00 +0000 Subject: Fix moving Emacs frames * exwm.el (exwm--on-ClientMessage): Avoid moving workspace frames; Move floating X window when trying to move the floating frame. --- exwm.el | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/exwm.el b/exwm.el index 36dbcb677f13..a2fbd0343993 100644 --- a/exwm.el +++ b/exwm.el @@ -479,7 +479,33 @@ ) ((= direction xcb:ewmh:_NET_WM_MOVERESIZE_CANCEL) (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 ((= type xcb:Atom:_NET_REQUEST_FRAME_EXTENTS) (let ((buffer (exwm--id->buffer id)) -- cgit 1.4.1