From f53cd297d716e421c4d510ded66aeb9d7d96f253 Mon Sep 17 00:00:00 2001 From: martin-s Date: Thu, 10 Mar 2011 12:14:18 +0000 Subject: Fix:Core:Make vehicle cursor have priority over layout cursor git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4323 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/vehicle.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'navit/vehicle.c') diff --git a/navit/vehicle.c b/navit/vehicle.c index ae404fc0..bec635ee 100644 --- a/navit/vehicle.c +++ b/navit/vehicle.c @@ -50,6 +50,7 @@ struct vehicle { // cursor struct cursor *cursor; + int cursor_fixed; struct callback *animate_callback; struct event_timeout *animate_timer; struct point cursor_pnt; @@ -235,7 +236,8 @@ vehicle_add_attr(struct vehicle *this_, struct attr *attr) break; // currently supporting oldstyle cursor config. case attr_cursor: - vehicle_set_cursor(this_, attr->u.cursor); + this_->cursor_fixed=1; + vehicle_set_cursor(this_, attr->u.cursor, 1); break; default: break; @@ -284,9 +286,11 @@ vehicle_remove_attr(struct vehicle *this_, struct attr *attr) * @author Ralph Sennhauser (10/2009) */ void -vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor) +vehicle_set_cursor(struct vehicle *this_, struct cursor *cursor, int overwrite) { struct point sc; + if (this_->cursor_fixed && !overwrite) + return; if (this_->animate_callback) { event_remove_timeout(this_->animate_timer); this_->animate_timer=NULL; // dangling pointer! prevent double freeing. -- cgit v1.2.1