Skip to content

Commit

Permalink
Inject the compositor state into handle-key-event
Browse files Browse the repository at this point in the history
This will make it easier to test if we ever get around to it.
  • Loading branch information
sdilts committed Nov 2, 2024
1 parent 5bfd290 commit e7cd922
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lisp/input.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
(t nil)))
(log-string :trace "Keyboard state: ~A" (mahogany-state-key-state *compositor-state*)))))))

(defun handle-key-event (key seat event-state)
(defun handle-key-event (state key seat event-state)
(declare (type key key)
(type bit event-state)
(optimize(speed 3)))
(let ((key-state (mahogany-state-key-state *compositor-state*)))
(let ((key-state (mahogany-state-key-state state)))
(declare (type key-state key-state))
(if (= event-state 1)
(or (check-and-run-keybinding key seat key-state)
Expand Down
2 changes: 1 addition & 1 deletion lisp/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
;; I'm not sure why this is an array, but it's what tinywl does:
(dotimes (i hrt:keysyms-len)
(let ((key (make-key (cffi:mem-aref hrt:keysyms :uint32 i) hrt:modifiers)))
(when (handle-key-event key seat hrt:wl-key-state)
(when (handle-key-event *compositor-state* key seat hrt:wl-key-state)
(return t))))))

(defmacro init-callback-struct (variable type &body sets)
Expand Down

0 comments on commit e7cd922

Please sign in to comment.