On Thu, Dec 18, 2003 at 06:47:10PM +0200, Ilpo Nyyss�nen wrote:
> Dominik Vogt <[EMAIL PROTECTED]> writes:
> 
> > On Wed, Dec 17, 2003 at 09:00:32PM +0200, Ilpo Nyyss�nen wrote:
> 
> [...]
> 
> >> But now I would like to have a keybinding that would focus the next
> >> window left AND scroll the screen so that it is just visible (and the
> >> same way to the right of course). It should not move the screen any
> >> more than necessary, so that the window where I just were is left
> >> visible.
> >> 
> >> Is this possible and how do I get it?
> >
> > Sure
> >
> >   destroyfunc focus_and_move_to_top_left
> >   addtofunc focus_and_move_to_top_left
> >   + I echo scrolling
> >   + I scroll $[w.x]p 0
> >   + I WarpPointer 0 0
> >   + I focus nowarp
> >
> >   key Left a CM direction w focus_and_move_to_top_left
> >   key Right a CM direction e focus_and_move_to_top_left
> >
> > You may want to change some of the details of this function.
> 
> To left that mostly does it, but to the right it doesn't. That always
> puts the window in the given direction to the left of the visible
> area, but when going to right, it should put it to the right. It
> should always scroll as little as possible but still make the window
> visible.

  destroyfunc focus_minimal_scroll
  addtofunc focus_minimal_scroll
  + I PipeRead "minimal_scroll.sh $[w.x] $[w.y] $[w.width] $[w.height] 0 0 $[vp.width] 
$[vp.height]"
  + I Focus nowarp
  + I WarpToWindow 0 0

  key Left a CM direction w focus_minimal_scroll
  key Right a CM direction e focus_minimal_scroll

PipeRead uses the attached shell script to do its calculations.
Put it in your $PATH and make it executable.

> Is it possible to scroll only when the given window is not totally in
> the visible area?
> 
> Also the WarpPointer doesn't seem to do anything.

I got the command name wrong.  It's "WarpToWindow".

Ciao

Dominik ^_^  ^_^

Attachment: minimal_scroll.sh
Description: Bourne shell script

Reply via email to