Re: [Sawfish] Pager still not working |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
Funnily enough I hit a similar bug just a few days ago, maybe it even
is the same one.
I was playing with X inside X and used a root window with rather
non-standard dimensions. Now it seems that sawfish assumes that the root
window is an exact multiple of the size of its pager. If not, some
functions which expect an integer, get a float value instead, which triggers
an error.
Sawfish communicates with its pager through code in pager.jl.
There is a macro 'scale', shown below
;; This is just to scale the window co-ords and dimensions.
(define-macro (scale val #!optional x up)
....
`(round (/ (* ,val (screen-width)) vp-width))
...)
Normally the result of that 'round' operation should be an int, but it depends:
(round (/ 8 4))
--> 2
however
(round (/ 7 4))
--> 2. ;; note the trailing dot, its a float
For me it works if I simply converted the result to an int, with the
somewhat strange-named function 'inexact->exact'. Thus
;; This is just to scale the window co-ords and dimensions.
'(define-macro (scale val #!optional x up)
(if x
(if up
`(inexact->exact (round (/ (* ,val (screen-width)) vp-width)))
`(inexact->exact (round (/ (* ,val vp-width) (screen-width)))))
(if up
`(inexact->exact (round (/ (* ,val (screen-height)) vp-height)))
`(inexact->exact (round (/ (* ,val vp-height) (screen-height)))))))
Since its a macro inside the structure sawfish.wm.ext.pager, it does not
work to simply redefine it; instead you have to fix it directly in the
source file, and you need to reload the whole file (or restart sawfish)
afterwards. It should work if you put an updated version somewhere in your
load-path before the original one, though.
Regards,
Womble
On 14/03/12 20:53, Krzysiek wrote:
> Hello. I still can't get Pager working. I've tried git version
> lately. Both sawfish and the pager.
> Pager appears but can't change workspace. Clicking on it does not change
> workspace. Generally clicks do nothing.
> Any tips? How to debug it better?
>
> Logs read:
>
> Lisp backtrace:
> #3 pager-goto (0 30 44)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<closure pager-goto @ sawfish.wm.ext.pager>, 937., 1
>
> Lisp backtrace:
> #3 pager-goto (0 77 49)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<closure pager-goto @ sawfish.wm.ext.pager>, 2455., 1
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 11 17 13 26 19)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 12 17 13 26 20)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 14 17 13 26 22)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 15 17 13 26 23)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 19 16 17 13 27 24)
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 14 17 13 26 22)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
> Sawfish error:
> Error: bad-arg, #<subr move-window-to>, 549., 2
>
> Lisp backtrace:
> #4 move-window-to ...
> #3 pager-move-window (10485763 18 15 17 13 26 23)
> #2 eval ...
> #1 user-eval ...
> #0 server-eval ...
>
>
--
--
Sawfish ML