about summary refs log tree commit diff
path: root/exwm-layout.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-04-01T15·38+0800
committerChris Feng <chris.w.feng@gmail.com>2018-04-01T15·38+0800
commit87db8b42a33876818ad8ee6b950c1f2aaa73d3d5 (patch)
treead5a9a395c68571fac3e3ec702650c279f706c50 /exwm-layout.el
parentfbdcd42b0a2aadb4f3e27cd2a75c863d2f67eb39 (diff)
Preserve keyboard grab state after quitting fullscreen mode
* exwm-layout.el (exwm-layout-set-fullscreen)
(exwm-layout-unset-fullscreen, exwm-layout-toggle-fullscreen): Ditto.
Diffstat (limited to 'exwm-layout.el')
-rw-r--r--exwm-layout.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/exwm-layout.el b/exwm-layout.el
index 847dd36389..b74f512a4e 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -166,7 +166,7 @@
                        :data (vector xcb:Atom:_NET_WM_STATE_FULLSCREEN)))
     (xcb:flush exwm--connection)
     (cl-pushnew xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)
-    (call-interactively #'exwm-input-release-keyboard)))
+    (exwm-input--release-keyboard exwm--id)))
 
 ;;;###autoload
 (cl-defun exwm-layout-unset-fullscreen (&optional id)
@@ -193,7 +193,8 @@
     (xcb:+request exwm--connection
         (make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id :data []))
     (xcb:flush exwm--connection)
-    (call-interactively #'exwm-input-grab-keyboard)))
+    (when exwm--keyboard-grabbed
+      (exwm-input--grab-keyboard exwm--id))))
 
 ;;;###autoload
 (cl-defun exwm-layout-toggle-fullscreen (&optional id)
@@ -204,7 +205,7 @@
   (when id
     (with-current-buffer (exwm--id->buffer id)
       (if (exwm-layout--fullscreen-p)
-          (exwm-reset)
+          (exwm-layout-unset-fullscreen id)
         (exwm-layout-set-fullscreen id)))))
 
 (defun exwm-layout--other-buffer-predicate (buffer)