[Sawfish] can sawfish auto-resize windows, when I am dragging them with a mouse?

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


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


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/