stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] New hook when a window is denied its raise-request


From: Lionel Flandrin
Subject: [STUMP] New hook when a window is denied its raise-request
Date: Wed, 09 Mar 2011 10:26:08 +0000
User-agent: Roundcube Webmail/0.5

I've added this hook to be able to handle some raise requests in a
custom way.

More precisely, it lets me create a new Emacs frame for my
*compilation* buffer, and every time I start a new compilation if this
window is not displayed I create a new frame at the bottom of my group
and pull it in.

Here's the code in my stumpwmrc to achieve that, if somebody's
interested:


(push '(:class "Emacs") stumpwm:*deny-raise-request*)

(defun emacs-display-compilation-buffer (window)
  (when (and (string= (window-class window) "Emacs")
             (string= (window-title window) "*compilation*")
             (not (window-visible-p window)))
    (let* ((group (window-group window))
(new-frame (frame-by-number group (split-frame group :row 4/5))))
      (when new-frame
        (frame-raise-window group new-frame window nil)
        (mapc #'update-decoration (group-windows group))))))

(add-hook *deny-raise-request-hook* 'emacs-display-compilation-buffer))


Cheers,
--
Lionel Flandrin

--
Lionel Flandrin

Attachment: 0001-Add-a-deny-raise-request-hook-called-when-a-window-i.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]