Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/primitives.lisp b/primitives.lisp
- index 50d062e..96ffa58 100644
- --- a/primitives.lisp
- +++ b/primitives.lisp
- @@ -40,6 +40,7 @@
- *focus-window-hook*
- *place-window-hook*
- *start-hook*
- + *quit-hook*
- *internal-loop-hook*
- *focus-frame-hook*
- *new-frame-hook*
- @@ -190,6 +191,9 @@ window group and frame")
- (defvar *start-hook* '()
- "A hook called when stumpwm starts.")
- +(defvar *quit-hook* '()
- + "A hook called when stumpwm quits.")
- +
- (defvar *internal-loop-hook* '()
- "A hook called inside stumpwm's inner loop.")
- diff --git a/stumpwm.lisp b/stumpwm.lisp
- index 845c745..65d4ba7 100644
- --- a/stumpwm.lisp
- +++ b/stumpwm.lisp
- @@ -267,4 +267,5 @@ of those expired."
- ((eq ret :restart))
- (t
- ;; the number is the unix return code
- + (run-hook *quit-hook*)
- (return-from stumpwm 0))))))
- diff --git a/window.lisp b/window.lisp
- index 81be639..8b3f6f3 100644
- --- a/window.lisp
- +++ b/window.lisp
- @@ -315,16 +315,37 @@ _NET_WM_STATE_DEMANDS_ATTENTION set"
- (xwin-net-wm-name win)
- (xlib:wm-name win)))
- +(defun maxmin-equal-p (win)
- + (let* ((xwin (window-xwin win))
- + (hints (xlib:wm-normal-hints xwin)))
- +
- + (with-accessors
- + ((min-width xlib:wm-size-hints-min-width)
- + (max-width xlib:wm-size-hints-max-width)
- + (min-height xlib:wm-size-hints-min-height)
- + (max-height xlib:wm-size-hints-max-height)) hints
- +
- + (and
- + hints
- + max-height
- + min-height
- + max-width
- + min-width
- + (= min-height max-height)
- + (= min-width max-width)))))
- +
- ;; FIXME: should we raise the winodw or its parent?
- (defmethod raise-window (win)
- "Map the window if needed and bring it to the top of the stack. Does not affect focus."
- - (when (window-urgent-p win)
- - (window-clear-urgency win))
- - (when (window-hidden-p win)
- - (unhide-window win)
- - (update-configuration win))
- - (when (window-in-current-group-p win)
- - (setf (xlib:window-priority (window-parent win)) :top-if)))
- + (let ((maxmin-notequal (not (maxmin-equal-p win))))
- + (when (window-urgent-p win)
- + (window-clear-urgency win))
- + (when (window-hidden-p win)
- + (unhide-window win)
- + (if maxmin-notequal
- + (update-configuration win)))
- + (when (and maxmin-notequal (window-in-current-group-p win))
- + (setf (xlib:window-priority (window-parent win)) :top-if))))
- ;; some handy wrappers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement