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
]
- To: sawfish@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [Sawfish] can sawfish auto-resize windows, when I am dragging them with a mouse?
- From: Mogei Wang <mogeiwang@xxxxxxxxx>
- Date: Sun, 14 Oct 2012 21:30:38 +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=vDpY6qy5pu+2YGvlzaP6Opr4SCrMCoqG6LeuJChxScM=; b=CaUR6UmdEM9PtNOg7QDYHAR85uHiXGmMhNc2tb7KqMnVQmxTC2E0oY0CBTMH6HxHqu jKbIWLdAVnOGwmQtvK370rh0diirmz2sC6W1rOsVPHXXjO/1SS70vwhd6nWGJ09sPaNc iJ0pVzA2QyCZgzMOfhb3euPDBMxj6VIeOlJxA0WzVZZucR117d3qHNLKoPTn8xgP9oGo /agjSE6uX9O3rmbdzJ2/O+fRm6Xt2P8EWSBE3ZvriyQWtdXK1MqE5woUJMVQpUFEnVAv UkvZO3YprQyogZOr+6YesFQ1NFt5fFNtLIcg+qgxQRV2qKv9/zRcneqCTYN47FBFE2pW iBOQ==
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