Re: Draft Animator Broken?
- From: Teika Kazura <teika lavabit com>
- To: sawfish-list gnome org
- Subject: Re: Draft Animator Broken?
- Date: Sat, 18 Apr 2009 14:25:00 +0900 (JST)
Hi, Chris. Attached is the patch for 'draft' animator.
I found subtlety (lawyers may call it a bug) in librep nubmer handling.
Floor, ceiling, round, and truncate return int type number
if librep is compiled *with* GMP support, and float without GMP.
That's why the draft animator worked for Chris, and not for me.
The patch fixes this situation, replacing (floor (/ ...)) with
(quotient ...).
Tell me, Chris, what is the value of following expressions in your env?
3/2 ;; for me 1.5
(eq 3/2 3/2) ;; nil. Use equal for non-int numbers.
(inexact->exact 3/2) ;; 1 (why not 3/2, or 1.5 ?)
(say, using (format standard-error "%s" ...))
I can't understand many of the code of librep/src/number.c ,
but an experiment tells ;)
More nasty things lie. I'm going to write librep manual for these
issues.
On Tue, 07 Apr 2009 23:46:46 +0200, Christopher Roy Bratusek wrote:
> Do you mean it does absolutely not work, or just
> displaying of dimensions? The later is the case for
> me, the former not. (Just to clarify things)
Now I experience the latter, too. I keep away from this point, having
no idea.
I wrote:
> One more minor related bug is there. In configurator, full animator
> options doesn't appear until you open move/resize section in UI.
More precisely, "animation" group customs are defined in
* wm/window-anim.jl (this is loaded)
* wm/animation/outline.jl
* wm/commands/move-resize.jl
The latter two have to be opened somewhere, but it is not the current
situation. One (ad-hoc) solution may be to collect all in move-resize.
I don't know how to solve it in an elegant way. There's a hidden
subtlety in sawfish init mechanism. If you carelessly add
(open sawfish.wm.animation.outline)
in wm/window-anim.jl, then sawfish doesn't start, leaving a message:
error--> (error "Unknown group (appearance animation)")
Yes, because the group "animation" is defined in window-anim.jl
itself, and 'open' does its job in precedence of loading the rest of
window-anim.jl, it fails.
I think a dev-doc is desirable which explains how sawfish initializes
itself. But my experience is not yet sufficient to write one.
Regards,
Teika (Teika kazura)
--- lisp/sawfish/wm/util/window-outline.jl 2009-04-13 22:10:16.945090772 +0900
+++ lisp/sawfish/wm/util/window-outline.jl 2009-04-13 22:10:16.945090772 +0900
@@ -158,7 +158,7 @@
(progn ; vertical
(if dim-p
(x-draw-string rw gc (cons (+ pta-x x-dim-offset)
- (+ pta-y (floor (/ delta-y 2)))
+ (+ pta-y (quotient delta-y 2))
)
(format nil "%d" delta-y)))
(if arrow-p
@@ -171,7 +171,7 @@
)
(progn ; horizontal
(if dim-p
- (x-draw-string rw gc (cons (+ pta-x (floor (/ delta-x 2)))
+ (x-draw-string rw gc (cons (+ pta-x (quotient delta-x 2))
(- pta-y y-dim-offset)
)
(format nil "%d" delta-x)))
@@ -190,23 +190,23 @@
((gc (x-create-root-xor-gc))
; window Upper (Left Middle Right)
(ul (cons x y))
- (um (cons (+ x (floor (/ width 2))) y))
+ (um (cons (+ x (quotient width 2)) y))
(ur (cons (+ x width) y))
; window Middle (Left Right)
- (ml (cons x (+ y (floor (/ height 2)))))
- (mr (cons (+ x width) (+ y (floor (/ height 2)))))
+ (ml (cons x (+ y (quotient height 2))))
+ (mr (cons (+ x width) (+ y (quotient height 2))))
; window Lower (Left Middle Right)
(ll (cons x (+ y height)))
- (lm (cons (+ x (floor (/ width 2))) (+ y height)))
+ (lm (cons (+ x (quotient width 2)) (+ y height)))
(lr (cons (+ x width) (+ y height)))
; window Screen (Left Right Top Bottom)
- (sl (cons 0 (+ y (floor (/ height 2)))))
- (sr (cons (screen-width) (+ y (floor (/ height 2)))))
- (st (cons (+ x (floor (/ width 2))) 0))
- (sb (cons (+ x (floor (/ width 2))) (screen-height)))
+ (sl (cons 0 (+ y (quotient height 2))))
+ (sr (cons (screen-width) (+ y (quotient height 2))))
+ (st (cons (+ x (quotient width 2)) 0))
+ (sb (cons (+ x (quotient width 2)) (screen-height)))
(offset 3) ; how much to offset the guidelines from the window
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]