diff options
-rw-r--r-- | wheelwork.lisp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/wheelwork.lisp b/wheelwork.lisp index d8637f1..fb4e5bb 100644 --- a/wheelwork.lisp +++ b/wheelwork.lisp @@ -70,7 +70,8 @@ necessary." are keyed by UNIT and hold Event-Handler instances.")) (defclass/std interactive () - ((listener :type (or null listener) :std nil :a)) + ((listener :type (or null listener) :std nil :a) + (focusablep :std t :doc "Whether or not this object can receive application focus.")) (:documentation "Supplies an object with a listener slot.")) (defun listener-table-for (listener event-type) @@ -339,8 +340,9 @@ necessary." (defun refocus-on (target &optional (app *application*)) - "Sets focus of application to target" - (setf (application-focus app) target)) + "Sets focus of application to TARGET, if TARGET is focusable. " + (when (focusablep target) + (setf (application-focus app) target))) (defun get-focus (&optional (app *application*)) (or (application-focus app) app)) |