detect if window is valid before maximize

This commit is contained in:
David Botton 2024-04-10 00:59:02 -04:00
parent 660db998d4
commit 32130bb30d

View file

@ -1153,6 +1153,7 @@ it is removed."
:focus (default t).")) :focus (default t)."))
(defmethod window-maximize ((obj clog-gui-window) &key (focus t)) (defmethod window-maximize ((obj clog-gui-window) &key (focus t))
(when (window-valid-p obj)
(bordeaux-threads:with-lock-held ((window-size-mutex obj)) ; prevent race condition of maximize/normalize (bordeaux-threads:with-lock-held ((window-size-mutex obj)) ; prevent race condition of maximize/normalize
(let ((app (connection-data-item obj "clog-gui"))) (let ((app (connection-data-item obj "clog-gui")))
(when focus (when focus
@ -1177,7 +1178,7 @@ it is removed."
(setf (width obj) (- (width obj) (setf (width obj) (- (width obj)
(body-left-offset app) (body-left-offset app)
(body-right-offset app))) (body-right-offset app)))
(fire-on-window-size-done obj))))) (fire-on-window-size-done obj))))))
;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;
;; window-normalize ;; ;; window-normalize ;;