Re: todo for edge-actions 1.9 [was: Re: mxflat theme broken with current git]



Christopher Roy Bratusek <nano tuxfamily org> writes:

> Great you're working on it. It's still edge-actions-1.9 (the branch is
> not yet done).

Well, here's *a* fix, though I don't know if it's the best one, or if
it's complete:

diff --git a/lisp/sawfish/wm/edge/flip.jl b/lisp/sawfish/wm/edge/flip.jl
index 11f1fec..026a46e 100644
--- a/lisp/sawfish/wm/edge/flip.jl
+++ b/lisp/sawfish/wm/edge/flip.jl
@@ -36,11 +36,16 @@
 
   (define-structure-alias edge-flip sawfish.wm.edge.flip)
 
+  (define edge-flip-timer nil)
+
   (define (edge-flip-invoke edge type #!key while-moving)
-    (make-timer (lambda ()
-                 (flip-core edge type #:while-moving while-moving))
-               (quotient edge-flip-delay 1000)
-               (mod edge-flip-delay 1000)))
+    (unless edge-flip-timer
+      (setq edge-flip-timer
+            (make-timer (lambda ()
+                          (setq edge-flip-timer nil)
+                          (flip-core edge type #:while-moving while-moving))
+                        (quotient edge-flip-delay 1000)
+                        (mod edge-flip-delay 1000)))))
 
   (define steps nil)


The problem is that many timers were being set while moving a window
across the viewport boundary -- this is evidently why I was seeing so
many more viewport jumps than you: I was setting the delay much larger.
This prevents that from happening, but I haven't yet looked into why
it's happening in the first place.  But this fix is possibly a good idea
anyway, since you could also trigger it by hitting the flipper multiple
times before the flip occurred, i.e., by hitting the edge, leaving the
edge, and hitting it again, within the delay.

Should this be done for hotspots too, do you think?

> For the delay issue... you're right ... there's a leave flipper hook,
> maybe we could use it to destroy the timer, but this will lead to the
> issue:
>
> short delay => moving mouse a bit = no action (edge-window is only 1px)
>
> So ... I'm not sure about the issue and would tend to leave as-is.

Well... for me it makes it unusable because I'm constantly flipping the
viewport by accident.  But honestly, I prefer keys for navigation
anyway; maybe the way it is now works well for those who like to use the
mouse.  So I have no problem with leaving it as-is.

-- 
Jeremy Hankins <nowan nowan org>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]