Compare

76a0f51d5c3274da8a741136baf6a57b410a096e..71b00a799de990c1bbe7cdc3b1c4d9e31d40864f

clwm-ext: sloppy-focus-follows-mouse-mixin

Raymond E. Pasco <ray@ameretat.dev> · 2026-10-27 06:25 UTC

Browse files
4 files changed, +29 −3
modified clwm-ext.lisp
@@ -3,4 +3,7 @@
3 3 ;;;; package for provided extensions
4 4
5 5 (defpackage #:clwm-ext
6 - (:use :cl :clwm))
6 + (:use :cl :clwm)
7 + (:export
8 + ;; sloppy-focus-follows-mouse-mixin
9 + #:sloppy-focus-follows-mouse-mixin))
added clwm-ext/sloppy-focus-follows-mouse-mixin.lisp mode 100644
@@ -0,0 +1,21 @@
1 + ;;;; common lisp window manager
2 + ;;;;
3 + ;;;; sloppy focus-follows-mouse (don't unfocus on moving out)
4 +
5 + (in-package #:clwm-ext)
6 +
7 + (defclass sloppy-focus-follows-mouse-mixin () ()
8 + (:documentation
9 + "Focus follows mouse, but entering the root doesn't unfocus."))
10 +
11 + (defmethod client-event-mask append
12 + ((wm sloppy-focus-follows-mouse-mixin) client)
13 + '(:enter-window))
14 +
15 + (defmethod handle-client-event
16 + ((wm sloppy-focus-follows-mouse-mixin) client
17 + (event-key (eql :enter-notify))
18 + &key mode kind)
19 + (if (and (eql mode :normal) (not (eql kind :inferior)))
20 + (focus-client wm client)
21 + (call-next-method)))
modified clwm.asd
@@ -14,5 +14,5 @@
14 14 (:module "ext"
15 15 :pathname "clwm-ext"
16 16 :serial t
17 - :components ())
17 + :components ((:file "sloppy-focus-follows-mouse-mixin")))
18 18 (:file "clwm-user")))
modified example-init.lisp
@@ -4,7 +4,9 @@
4 4
5 5 (in-package #:clwm-user)
6 6
7 - (defclass my-wm (wm) ())
7 + (defclass my-wm (sloppy-focus-follows-mouse-mixin
8 + wm)
9 + ())
8 10
9 11 (run-wm 'my-wm)
10 12