From 014f413770096568320199de7d13ac10d2f34ec1 Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Wed, 16 Feb 2011 11:47:09 +0100 Subject: [PATCH] src/clfswm.lisp (main-unprotected): Add a close hook. And close the notify window, the virtual keyboard and the clfswm terminal by default. --- ChangeLog | 6 ++++++ src/clfswm-corner.lisp | 10 ++++++++++ src/clfswm.lisp | 2 +- src/config.lisp | 3 +++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 44cba04..924f4f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-02-16 Philippe Brochard + + * src/clfswm.lisp (main-unprotected): Add a close hook. And close + the notify window, the virtual keyboard and the clfswm terminal by + default. + 2011-02-15 Philippe Brochard * src/clfswm.lisp (main-unprotected): Destroy the notify window diff --git a/src/clfswm-corner.lisp b/src/clfswm-corner.lisp index 1a4fd4e..4f346f0 100644 --- a/src/clfswm-corner.lisp +++ b/src/clfswm-corner.lisp @@ -104,6 +104,11 @@ Corner is one of :bottom-right :bottom-left :top-right :top-left" (let (win) + (defun close-virtual-keyboard () + (when win + (xlib:destroy-window win) + (xlib:display-finish-output *display*) + (setf win nil))) (defun present-virtual-keyboard () "Present a virtual keyboard" (setf win (generic-present-body *virtual-keyboard-cmd* @@ -117,6 +122,11 @@ Corner is one of :bottom-right :bottom-left :top-right :top-left" (defun equal-clfswm-terminal-id (window) (when win (equal (xlib:window-id window) (xlib:window-id win)))) + (defun close-clfswm-terminal () + (when win + (xlib:destroy-window win) + (xlib:display-finish-output *display*) + (setf win nil))) (defun present-clfswm-terminal () "Hide/Unhide a terminal" (setf win (generic-present-body *clfswm-terminal-cmd* diff --git a/src/clfswm.lisp b/src/clfswm.lisp index aa24217..0f80e70 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -275,7 +275,7 @@ (ungrab-main-keys) (xlib:destroy-window *no-focus-window*) (xlib:free-pixmap *pixmap-buffer*) - (close-notify-window) + (call-hook *close-hook*) (xlib:close-display *display*) #+:event-debug (format t "~2&Unhandled events: ~A~%" *unhandled-events*)))) diff --git a/src/config.lisp b/src/config.lisp index f233b73..023ec52 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -151,6 +151,9 @@ This command must set the window title to *clfswm-terminal-name*") (defparameter *init-hook* '(default-init-hook display-hello-window) "Config(Hook group): Init hook. This hook is run just after the first root frame is created") +(defparameter *close-hook* '(close-notify-window close-clfswm-terminal close-virtual-keyboard) + "Config(Hook group): Close hook. This hook is run just before closing the display") + (defparameter *default-nw-hook* 'default-frame-nw-hook "Config(Hook group): Default action to do on newly created windows") -- 2.11.4.GIT