[Sawfish] can sawfish auto-resize windows, when I am dragging them with a mouse? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: [Sawfish] can sawfish auto-resize windows, when I am dragging them with a mouse?
- From: Mogei Wang <mogeiwang@xxxxxxxxx>
- Date: Fri, 12 Oct 2012 00:14:50 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=OHP7NOHHwGPPnLgxqt4thqt+asAisSg3QcYZ2VarUVE=; b=Z1wtJK4rL0LDg4ngoZgVKgWbXFm1kkSukafseaVQjA1WbBXXmgwH6KmB9lL+YcpINf zwCCE4Frbu3IShG7wUXjj/gwRBa2IRRL4h5TPetjsltr6JFMaDHiU6pZAbstVsRTFRFV uzzLiu3CADmppGAwthu/ygyw5vCLBOkArl8Y9O+8+IEQ8comnKrxia9D/y/8ny1NY2qr 4lkTYqrn/JH0Q8Y3mgAErngApNbbvJEi9v4xsNHLOyzt2KALByx/VNNIBe1nrltvHyyW yDxxpbySZWaeZfIcE35ecuy8nsOHIEVdJ+hjIHpnVetqpaX++QChReX1wZDHU/Pta+zD kAJw==
Hi,
Can sawfish resize the window to 1/4th of the screen, when it is
dragged to some corner of the screen? I cannot find such scripts.
Could someone address this feature?
Thanks in advance!
yours, m.w.
----------------------------------------------------------------------------------------------------------------------
;; I have tried to write some code.
;; this below function, which is based on no-mouse, can send windows
to corners with certain areas.
;; would someone please bind it to windows moving actions?
(defun rsk-grid-resize-place-window (grid)
"resize the window, and move it to the grid position specified by
the numeric keypad"
(interactive)
(let* ((win (input-focus)) (x 0) (y 0) (a (/ (screen-width) 2)) (b
(/ (screen-height) 2)) )
(cond
((or (eq grid 1) (eq grid 2) (eq grid 4) (eq grid 7) (eq grid 8))
(setq x 64)) ;; put the panel on the left
((or (eq grid 3) (eq grid 6) (eq grid 9)) (setq x (+ (/
(screen-width) 2) 64) ))
((or (eq grid 5)) (setq x (+ (/ (screen-width) 4) 64) )))
(cond
((or (eq grid 4) (eq grid 6) (eq grid 7) (eq grid 8) (eq grid 9))
(setq y 0))
((or (eq grid 1) (eq grid 2) (eq grid 3)) (setq y (/ (screen-height) 2)))
((or (eq grid 5)) (setq y (/ (screen-height) 4))))
(cond
((or (eq grid 2) (eq grid 8)) (setq a (screen-width)))
( t (setq a (/ (screen-width) 2))))
(cond
((or (eq grid 4) (eq grid 6)) (setq b (screen-height) ))
( t (setq b (/ (screen-height) 2))))
;; the following is necessary because "/" function can result in
fractional numbers
(setq x (truncate x)) (setq y (truncate y)) (setq a (truncate a))
(setq b (truncate b))
(move-resize-window-to win x y a b) (display-window win)))
--
Sawfish ML