From a5544de767dc8c897d66d2722520160b8b2bdbda Mon Sep 17 00:00:00 2001 From: David Botton Date: Tue, 9 Apr 2024 22:19:15 -0400 Subject: [PATCH] improved popup --- source/clog-window.lisp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/clog-window.lisp b/source/clog-window.lisp index 62c2552..9b301a1 100644 --- a/source/clog-window.lisp +++ b/source/clog-window.lisp @@ -652,14 +652,19 @@ obj of the new window on the new connection or nil if failed within :WAIT-TIMEOU (setf (gethash sync-key *clog-popup-sync-hash*) sem) (bordeaux-threads:wait-on-semaphore sem :timeout wait-timeout) (setf sem (gethash sync-key *clog-popup-sync-hash*)) + (remhash sync-key *clog-popup-sync-hash*) (if (typep sem 'clog-obj) - (values sem new-win) + (progn + (setf (connection-data-item sem "clog-popup") new-win) + (values sem new-win)) nil))) (defun clog-popup-openned (obj sync-key) "Used to notify open-clog-popup the new popup window is ready for custom clog-popup handlers." (let ((sem (gethash sync-key *clog-popup-sync-hash*))) - (when sem - (setf (gethash sync-key *clog-popup-sync-hash*) (connection-body obj)) - (bordeaux-threads:signal-semaphore sem)))) + (cond (sem + (setf (gethash sync-key *clog-popup-sync-hash*) (connection-body obj)) + (bordeaux-threads:signal-semaphore sem)) + (t + (create-div obj :content "Invalid Sync")))))