diff --git a/src/callback.c b/src/callback.c index 28a2872c..411ca8a0 100644 --- a/src/callback.c +++ b/src/callback.c @@ -1001,6 +1001,7 @@ void draw_crosshair(int del) sdw = xctx->draw_window; sdp = xctx->draw_pixmap; + if(!xctx->mouse_inside) return; xctx->draw_pixmap = 0; xctx->draw_window = 1; @@ -1144,8 +1145,10 @@ int rstate; /* (reduced state, without ShiftMask) */ { case LeaveNotify: draw_crosshair(1); + xctx->mouse_inside = 0; break; case EnterNotify: + xctx->mouse_inside = 1; if(tclgetboolvar("draw_crosshair")) tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL); else diff --git a/src/xinit.c b/src/xinit.c index 0b8261fe..1027e32d 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -608,6 +608,7 @@ static void alloc_xschem_data(const char *top_path, const char *win_path) xctx->enable_drill = 0; xctx->prev_set_modify = -1; xctx->prev_crossx = xctx->prev_crossy = 0.0; + xctx->mouse_inside = 0; xctx->pending_fullzoom = 0; my_strncpy(xctx->hiersep, ".", S(xctx->hiersep)); xctx->no_undo = 0; diff --git a/src/xschem.h b/src/xschem.h index 0ddedeec..0294016f 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -977,6 +977,7 @@ typedef struct { double p_xx1,p_xx2,p_yy1,p_yy2; /* draw_crosshair */ double prev_crossx, prev_crossy; + int mouse_inside; /* set_modify */ int prev_set_modify; /* pan */