about summary refs log tree commit diff
path: root/exwm-input.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-07-14T16·00+0800
committerChris Feng <chris.w.feng@gmail.com>2018-07-14T16·00+0800
commitbc5f0b3ffac4d262d4b8537baae0baf72402d079 (patch)
tree53aef68c2b48afe8c907808ad98235ece354306a /exwm-input.el
parent1364f80f09668a16358aa8f509266bae41d55685 (diff)
; Use `derived-mode-p'.
Diffstat (limited to 'exwm-input.el')
-rw-r--r--exwm-input.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/exwm-input.el b/exwm-input.el
index 55949aa1b29a..80ab352109a3 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -224,7 +224,7 @@ ARGS are additional arguments to CALLBACK."
               ;; The X window is on another workspace.
               (exwm-workspace-switch frame)
             (with-current-buffer buffer
-              (when (and (eq major-mode 'exwm-mode)
+              (when (and (derived-mode-p 'exwm-mode)
                          (not (eq exwm--frame exwm-workspace--current)))
                 ;; The floating X window is on another workspace.
                 (exwm-workspace-switch exwm--frame)))))
@@ -295,7 +295,7 @@ ARGS are additional arguments to CALLBACK."
   "Update input focus."
   (when (window-live-p window)
     (with-current-buffer (window-buffer window)
-      (if (eq major-mode 'exwm-mode)
+      (if (derived-mode-p 'exwm-mode)
           (if (not (eq exwm--frame exwm-workspace--current))
               (progn
                 (set-frame-parameter exwm--frame 'exwm-selected-window window)
@@ -369,14 +369,14 @@ ARGS are additional arguments to CALLBACK."
       (cond ((and (eq button-event exwm-input-move-event)
                   ;; Either an undecorated or a floating X window.
                   (with-current-buffer buffer
-                    (or (not (eq major-mode 'exwm-mode))
+                    (or (not (derived-mode-p 'exwm-mode))
                         exwm--floating-frame)))
              ;; Move
              (exwm-floating--start-moveresize
               event xcb:ewmh:_NET_WM_MOVERESIZE_MOVE))
             ((and (eq button-event exwm-input-resize-event)
                   (with-current-buffer buffer
-                    (or (not (eq major-mode 'exwm-mode))
+                    (or (not (derived-mode-p 'exwm-mode))
                         exwm--floating-frame)))
              ;; Resize
              (exwm-floating--start-moveresize event))
@@ -389,7 +389,7 @@ ARGS are additional arguments to CALLBACK."
                      ;; The X window is on another workspace
                      (exwm-workspace-switch frame)
                    (with-current-buffer buffer
-                     (when (and (eq major-mode 'exwm-mode)
+                     (when (and (derived-mode-p 'exwm-mode)
                                 (not (eq exwm--frame
                                          exwm-workspace--current)))
                        ;; The floating X window is on another workspace
@@ -410,7 +410,7 @@ ARGS are additional arguments to CALLBACK."
   "Handle KeyPress event."
   (let ((obj (make-instance 'xcb:KeyPress)))
     (xcb:unmarshal obj data)
-    (if (eq major-mode 'exwm-mode)
+    (if (derived-mode-p 'exwm-mode)
         (funcall exwm--on-KeyPress obj data)
       (exwm-input--on-KeyPress-char-mode obj))))
 
@@ -613,7 +613,7 @@ instead."
                                   exwm--connection (car keysym)
                                   (logand state (lognot (cdr keysym)))))
                  (setq event (exwm-input--mimic-read-event raw-event)))
-        (if (not (eq major-mode 'exwm-mode))
+        (if (not (derived-mode-p 'exwm-mode))
             (exwm-input--unread-event raw-event)
           ;; Grab keyboard temporarily.
           (setq exwm-input--temp-line-mode t)