about summary refs log tree commit diff
path: root/exwm.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2015-08-10T02·55+0800
committerChris Feng <chris.w.feng@gmail.com>2015-08-10T02·55+0800
commit2d4104a0eceb7d043ed1cd6bdd1bda1db4f91a73 (patch)
treef5c4ff13d71d6d2a843e7478398822112cac272a /exwm.el
parentedc70eb6616b818463c94b5ab8c9e3f1dfd177c9 (diff)
Fix emacsclient bugs
`emacsclient` started with `-c` or `-t` argument create a new frame that shall
not be used to manage X windows.
Also fix some related input focus issues (with some remaining unfixed).
Close #17.
Diffstat (limited to 'exwm.el')
-rw-r--r--exwm.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/exwm.el b/exwm.el
index 7c9fa59410..4c4d4aff9c 100644
--- a/exwm.el
+++ b/exwm.el
@@ -195,6 +195,9 @@
 (defun exwm-reset ()
   "Reset window to standard state: non-fullscreen, line-mode."
   (interactive)
+  (unless (frame-parameter nil 'exwm-window-id)
+    ;; Move focus away form a non-EXWM frame
+    (x-focus-frame exwm-workspace--current))
   (with-current-buffer (window-buffer)
     (when (eq major-mode 'exwm-mode)
       (when exwm--fullscreen (exwm-layout-unset-fullscreen))
@@ -400,7 +403,8 @@
                (exwm--update-state id t))
               ((= atom xcb:Atom:_NET_WM_USER_TIME)) ;ignored
               (t (exwm--log "Unhandled PropertyNotify: %s(%d)"
-                            (x-get-atom-name atom) atom)))))))
+                            (x-get-atom-name atom exwm-workspace--current)
+                            atom)))))))
 
 (defun exwm--on-ClientMessage (raw-data synthetic)
   "Handle ClientMessage event."
@@ -628,9 +632,6 @@
         (exwm-input--init)
         (exwm-randr--init)
         (exwm--unlock)
-        ;; Disable events during new frame creation
-        (add-hook 'before-make-frame-hook 'exwm--lock)
-        (add-hook 'after-make-frame-functions 'exwm--unlock)
         ;; Manage exiting windows
         (exwm-manage--scan)
         (run-hooks 'exwm-init-hook)))))