Need some explanations on the Taviso's Locking Slide func

Hello there,

i don’t understand anything with this function !

[code]*Side: (5x1024, Action(Mouse 1) Next (CirculateHit, Side) PipeRead ‘echo LockingSlide $$(test $$(($[w.x]+$[w.width])) -le $[vp.width] && echo w$$(($[w.width]-$width))p || echo w-$$(($[w.width]-$width))p) keep’)

DestroyFunc LockingSlide
AddToFunc LockingSlide

  • I Test (!State 2) Break
  • I State 2 False
  • I AnimatedMove $0 $1
  • I State 2 True
    [/code]

Can someone explains me slowly every words of this function please ?

The function just makes sure that if a window is being moved via AnimatedMove, and then is called again, whilst the window is till being moved, that it doesn’t. The problem would be that the window would get confused as to where/what was happening. So a state is put on the window to ensure this does not happen.

– Thomas Adam.

Hum ok…
But can you explain me in details this line :

echo LockingSlide $$(test $$(($[w.x]+$[w.width])) -le $[vp.width] && echo w$$(($[w.width]-$width))p || echo w-$$(($[w.width]-$width))p) keep

This makes me mad :frowning:

for instance, what is the $width var ?!
And where are the two arguments that LockingSlide takes ?
What is the w before $$(($[w.width]-$width))p for exemple…
And why $[w.x]+$[w.width] since this the same !!! ($[w.x] = $[w.width])

Sure. It’s just mathematics, lucky. It takes the windows location (in pixels) and adds it to the windows width (in pixels), and checks to see if it is less than or equal to the width of the viewport – that’s important, as it needs to know whether to make it slide up, or slide out, so you can see it. If it is less than or equal to the VP’s width, it will then pass to the LockingSlide function the difference, otherwise it will do the same operations, but for the inverse – so that it slides inwards.

It’s one of those things, that if you want to see what it does, to put:

+ I Echo "First Parameter: $0"
+ I Echo "Second Parameter: $1"

… to the top of the LockingSlide function, so you can see what’s happening, for both cases, when you make the shelf slide outwards and inwards.

– Thomas Adam.

Ok I understand ! Thnak you very much :smiley:
I am able to modify this function to my suits, cool.

just on thing : what is the $width ?

edit : just understand -> $width is the width of the current button. Great Function :smiley:

Ok so now i have a problem with it.
Here my Dock config.

[code]DestroyModuleConfig Side: *
*Side: Frame 2
*Side: Geometry 160x$[vp.height]-0+0
*Side: Rows 1024
*Side: Columns 160
*Side: Padding 0 0
*Side: BoxeSize fixed
*Side: Font “xft:Lucida Grande:size=9”
*Side: (160x5, Frame 1, Action(Mouse 1) Next (CirculateHit, Side) PipeRead 'echo LockingSlide keep $$(test $$(($[w.y]+$[w.height])) -le $[vp.height] && echo w-$$(($[w.height]-$height))p || echo w$$(($[w.height]-$height))p)')

*Side: (160x30, Swallow FvwmScript “FvwmScript $[scripts]/DateScript”, Frame 0)
*Side: (160x20, Swallow FvwmScript “FvwmScript $[scripts]/TimeScript”, Frame 0)
*Side: (160x10, Frame 0)
*Side: (160x160, Swallow FvwmPager “Module FvwmPager *”, Frame 0)
*Side: (40x25, Title 1, Action(Mouse 1) “GoToDesk 0 0”)
*Side: (40x25, Title 2, Action(Mouse 1) “GoToDesk 0 1”)
*Side: (40x25, Title 3, Action(Mouse 1) “GoToDesk 0 2”)
*Side: (40x25, Title 4, Action(Mouse 1) “GoToDesk 0 3”)
*Side: (160x20, Frame 0)
*Side: (160x25, Title(side) " Terminal", Left, Icon term.png, Action(Mouse 1) “Exec rxvt”)
*Side: (160x25, Title(side) " File Manager", Left, Icon home.png, Action(Mouse 1) “Exec rox”)
*Side: (160x25, Title(side) " Editor", Left, Icon gvim.png, Action(Mouse 1) “Exec gvim”)
*Side: (160x13, Frame 0)
*Side: (160x25, Title(side) " Web browser", Left, Icon firefox.png, Action(Mouse 1) “Exec firefox”)
*Side: (160x25, Title(side) " Email client", Left, Icon thunderbird.png, Action(Mouse 1) “Exec thunderbird”)
*Side: (160x25, Title(side) " Jabber client", Left, Icon gaim.png, Action(Mouse 1) “Exec gaim”)
*Side: (160x25, Title(side) " Irc client", Left, Icon irssi.png,Action(Mouse 1) “Exec rxvt -g 95x50 -e irssi”)
*Side: (160x25, Title(side) " Gftp", Left, Icon gftp.png, Action(Mouse 1) “Exec gftp”)
*Side: (160x25, Title(side) " Mldonkey", Left, Icon sancho.png, Action(Mouse 1) “Exec sancho”)
*Side: (160x13, Frame 0)
*Side: (160x25, Title(side) " Gqview", Left, Icon gqview.png, Action(Mouse 1) “Exec gqview”)
*Side: (160x25, Title(side) " The Gimp", Left, Icon gimp.png, Action(Mouse 1) “Exec gimp-2.2”)
*Side: (160x25, Title(side) " Sticky note", Left, Icon note.png, Action(Mouse 1) “Exec xpad”)
*Side: (160x13, Frame 0)
*Side: (160x25, Title(side) " FvwmConsole", Left, Icon term.png, Action(Mouse 1) “Module FvwmConsole -terminal rxvt”)
*Side: (160x25, Title(side) " Edit file config", Left, Icon config.png, Action(Mouse 1) “Exec gvim -geom 88x40 $[FVWM_USERDIR]/.fvwm2rc”)
*Side: (160x25, Title(side) " Run…", Left, Icon run.png, Action(Mouse 1) “Exec gmrun”)
*Side: (160x13, Frame 0)
*Side: (160x25, Title(side) " Restart", Left, Icon restart.png, Action(Mouse 1) “Restart”)
*Side: (160x25, Title(side) " Log out", Left, Icon quit.png, Action(Mouse 1) “Module FvwmForm Exit”)
*Side: (160x13, Frame 0)
*Side: (32x32, Frame 0, Icon media-previous.png, Action(Mouse 1) “Exec xmms -r”,
Action(Mouse 4) Exec xmms-shell -e 'upvolume',
Action(Mouse 5) Exec xmms-shell -e 'downvolume',
Action(Mouse 3) Menu XMMSControl)
*Side: (32x32, Frame 0, Icon media-stop.png, Action(Mouse 1) “Exec killall xmms”,
Action(Mouse 4) Exec xmms-shell -e 'upvolume',
Action(Mouse 5) Exec xmms-shell -e 'downvolume',
Action(Mouse 3) Menu XMMSControl)
*Side: (32x32, Frame 0, Icon media-play.png, Action(Mouse 1) “Exec xmms -p”,
Action(Mouse 4) Exec xmms-shell -e 'upvolume',
Action(Mouse 5) Exec xmms-shell -e 'downvolume',
Action(Mouse 3) Menu XMMSControl)
*Side: (32x32, Frame 0, Icon media-pause.png, Action(Mouse 1) “Exec xmms -u”,
Action(Mouse 4) Exec xmms-shell -e 'upvolume',
Action(Mouse 5) Exec xmms-shell -e 'downvolume',
Action(Mouse 3) Menu XMMSControl)
*Side: (32x32, Frame 0, Icon media-next.png, Action(Mouse 1) “Exec xmms -f”,
Action(Mouse 4) Exec xmms-shell -e 'upvolume',
Action(Mouse 5) Exec xmms-shell -e 'downvolume',
Action(Mouse 3) Menu XMMSControl)
*Side: (160x13, Frame 0)
*Side: (160x224, Frame 0, Swallow “FvwmIconMan” “Module FvwmIconMan”)
*Side: Colorset 9
Style Side Sticky, NoTitle, WindowListSkip, StaysOnBottom, NeverFocus, FixedSize !Borders, !Handles
[/code]
I would like to hide this dock from up to down. But when i clic on the button, the dock always move down… What’s wrong with

*Side: (160x5, Frame 1, Action(Mouse 1) `Next (CirculateHit, Side) PipeRead 'echo LockingSlide keep $$(test $$(($[w.y]+$[w.height])) -le $[vp.height] && echo w-$$(($[w.height]-$height))p || echo w$$(($[w.height]-$height))p)'`)

?

Thank you for yours answer.

*Side: (5x1024, Action(Mouse 1) `Next (CirculateHit, Side) PipeRead 'echo LockingSlide keep $$(test $$(($[w.y]+$[w.height])) -le $[vp.height] && echo w$$(($[w.height]-$width))p || echo w-$$(($[w.height]-$width))p)'`)

Works fine !

But i want from up to down so :

*Side: (5x1024, Action(Mouse 1) `Next (CirculateHit, Side) PipeRead 'echo LockingSlide keep $$(test $$(($[w.y]+$[w.height])) -le $[vp.height] && echo w-$$(($[w.height]-$width))p || echo w+$$(($[w.height]-$width))p)'`)
But here, it doesn’t work ! Why this work from down to up and not from up to down ?!
I don’t understand… Snif.

edit : the height dock = $[vp.height]

edit2 : it works fine :slight_smile: