[Xfce4-commits] <xfce4-eyes-plugin:master> Optimize check in timer callback a bit.
Harald Judt
noreply at xfce.org
Sun Mar 3 10:08:01 CET 2013
Updating branch refs/heads/master
to 9463e7a9416d3f293f7f0e72669a4ce27884ebd2 (commit)
from 88c2ec822210f0efa7ee2b6c99bc4747bf3fd71d (commit)
commit 9463e7a9416d3f293f7f0e72669a4ce27884ebd2
Author: Harald Judt <h.judt at gmx.at>
Date: Sun Mar 3 09:55:26 2013 +0100
Optimize check in timer callback a bit.
It won't help much because there are not that many eyes, but then
it also won't hurt, so stop checking when we know the pointer has
not been moved.
panel-plugin/eyes.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index aa3cf48..c9780dc 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -162,13 +162,18 @@ timer_cb(EyesPlugin *eyes)
if ((x != eyes->pointer_last_x[i]) || (y != eyes->pointer_last_y[i]))
{
-
calculate_pupil_xy (eyes, x, y, &pupil_x, &pupil_y, eyes->eyes[i]);
draw_eye (eyes, i, pupil_x, pupil_y);
eyes->pointer_last_x[i] = x;
eyes->pointer_last_y[i] = y;
}
+ else
+ {
+ /* pointer position did not change since last poll, so
+ why would it be different for the remaining eyes? */
+ break;
+ }
}
}
More information about the Xfce4-commits
mailing list