Re: [PATCH] maximize-horizontally/vertically behaviour change + fix
- From: dmg <dmg uvic ca>
- To: General discussion about sawfish wm <sawfish-list gnome org>
- Subject: Re: [PATCH] maximize-horizontally/vertically behaviour change + fix
- Date: Sat, 12 Dec 2009 22:15:40 -0800
On Tue, Dec 8, 2009 at 6:37 AM, Christopher Roy Bratusek
<zanghar freenet de> wrote:
> Am Tue, 8 Dec 2009 03:11:33 -0800
> schrieb dmg <dmg uvic ca>:
>> Hi everybody,
>> one thing that I have been wanting is an automatic maximize of windows
>> when there is a change in the size of the screen.
>> I use a tablet, and when the display is put in slate mode I need to
>> unmaximize-maximize windows manually. Does anybody
>> know where should I hook to the even of resizing the size of the
>> thanks a lot!
>> --(the other) daniel
> Actually sawfish does completely ignore the resolution-changed
> notification. It's marked as BLOCKER for 3.0, though.
This got me thinking. The size of the screen is updated when xrandr
rotates the screen. Hence I thought sawfish was handling
the event. I looked today at events.c and found a hook:
'configure-notify-hook that gets executed by the same code that
resets the size of the screen.
So I hooked a function, and yes, it works. This is my current hooked
function (it could be improved to handle
moving the current window inside the boundaries of the screen and to
make sure there is one window to resize.
(Something else I'd like to implement is the ability to keep 2
geometries: one for portrait and one for landscape mode,
similar to the way Maximize keeps the geometry before the maximization).
(defun dmg-after-rotate ()
(dmg-remaximize-window (car (window-order current-workspace nil nil)))
(display-message "This is a test3")
(add-hook 'configure-notify-hook dmg-after-rotate)
;;; this is my remaximize window.
(defun dmg-remaximize-window (w )
"remaximize the given window"
(m (window-maximized-p w))
(h (window-maximized-horizontally-p w))
(v (window-maximized-vertically-p w))
(if (and m)
((and v h)
) ; and v h
) ; and v
) ; end cond
) ; end progn
) ; end let
Daniel M. German
] [Thread Prev