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

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


This is only a note. The line

(defvar-setq bottom-edge-move-function (lambda (win)
(rsk-grid-resize-place-window 2 win) ))

act strange on my machine. The focused window does not place as the
function "rsk-grid-resize-place-window" defined. Instead, the window
is restored to its original location after a splash.  I do not know
the reason.

Fortunately, the following line is okay:
(defvar-setq bottom-edge-move-function
  (lambda () (let ((win (current-event-window)))
(rsk-grid-resize-place-window 2 win) (release-windows #:center win))))


The function "rsk-grid-resize-place-window" is:

(defun rsk-grid-resize-place-window (grid win)
  "resize the window, and move it to the grid position specified by
the numeric keypad"
  (let* ( (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))
    ((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) 5) ))
    ((or (eq grid 5)) (setq y (/ (screen-height) 4))))
   (cond
    ((or (eq grid 2) (eq grid 8)) (setq a (- (screen-width) 62)))
    ( t (setq a (/ (- (screen-width) 62) 2))))
   (cond
    ((or (eq grid 4) (eq grid 6)) (setq b (- (screen-height) 15) ))
    ( 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)
    ))

With regards, M.W.



On Fri, Oct 12, 2012 at 2:21 AM, Christopher Roy Bratusek
<nano@xxxxxxxxxxxxx> wrote:
> There are EdgeActions. You can enable them from SawfishConfig => EdgeActions.
>
> There's expand action that resizes a window to the half screen-size according
> to the edge window was dragged (nothing stock for 25%).
>
> Via ~/.sawfish{/rc,rc} you may do something like
>
> (defvar-setq top-edge-move-function
>   (lambda (win) (some-fancy-func-to-achieve-what-you-want win)))
>
> I strongly suggest reading EdgeActions docs:
>
> info sawfish Workspace EdgeActions
>
> On Friday 12 October 2012 00:14:50 Mogei Wang wrote:
>> 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.
>
>
> --
> Sawfish ML
>

-- 
Sawfish ML


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