about summary refs log tree commit diff
path: root/exwm-floating.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-18T04·55+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-18T04·55+0800
commitc22f35620f0db3e86f4b0678a29dc3eee48df4d9 (patch)
tree3f31aa278a5f19614f67b5be3b8babcf678b1242 /exwm-floating.el
parent1a716d39397edfc2a083c479817ea7d40b23fd54 (diff)
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.
Diffstat (limited to 'exwm-floating.el')
-rw-r--r--exwm-floating.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/exwm-floating.el b/exwm-floating.el
index 9d4d948d30a9..20b3fc454e12 100644
--- a/exwm-floating.el
+++ b/exwm-floating.el
@@ -70,6 +70,7 @@
 (defvar exwm-workspace--list)
 (defvar exwm-workspace-current-index)
 (defvar exwm-workspace--switch-history-outdated)
+(defvar exwm-workspace--struts)
 
 (declare-function exwm-layout--refresh "exwm-layout.el" ())
 (declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
@@ -242,7 +243,18 @@
           (exwm-floating-hide))
       (with-selected-frame exwm-workspace--current
         (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)
   ;; Redraw the frame.
   (redisplay))