Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 25335) +++ trunk/src/crosshair.c (revision 25336) @@ -1120,7 +1120,7 @@ } } -void pcb_event_move_crosshair(pcb_coord_t ev_x, pcb_coord_t ev_y) +static void pcb_event_move_crosshair(pcb_coord_t ev_x, pcb_coord_t ev_y) { if (pcb_mid_stroke) pcb_stub_stroke_record(ev_x, ev_y); @@ -1166,9 +1166,13 @@ } -void pcb_hidlib_crosshair_move_to(pcb_coord_t abs_x, pcb_coord_t abs_y) +void pcb_hidlib_crosshair_move_to(pcb_coord_t abs_x, pcb_coord_t abs_y, int mouse_mot) { - pcb_notify_crosshair_change(pcb_false); - pcb_crosshair_move_absolute(abs_x, abs_y); - pcb_notify_crosshair_change(pcb_true); + if (!mouse_mot) { + pcb_notify_crosshair_change(pcb_false); + pcb_crosshair_move_absolute(abs_x, abs_y); + pcb_notify_crosshair_change(pcb_true); + } + else + pcb_event_move_crosshair(abs_x, abs_y); } Index: trunk/src/crosshair.h =================================================================== --- trunk/src/crosshair.h (revision 25335) +++ trunk/src/crosshair.h (revision 25336) @@ -107,11 +107,6 @@ void pcb_crosshair_range_to_buffer(void); void pcb_crosshair_set_local_ref(pcb_coord_t X, pcb_coord_t Y, pcb_bool Showing); - -/* Event handler to set the cursor according to the X pointer position - called from inside main.c */ -void pcb_event_move_crosshair(pcb_coord_t ev_x, pcb_coord_t ev_y); - /*** utility for plugins ***/ void pcb_xordraw_attached_line(pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t, pcb_coord_t); void pcb_xordraw_poly(pcb_poly_t *polygon, pcb_coord_t dx, pcb_coord_t dy, int dash_last); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 25335) +++ trunk/src/gui_act.c (revision 25336) @@ -1014,7 +1014,7 @@ dy += radius; } - pcb_event_move_crosshair(pcb_crosshair.X + dx, pcb_crosshair.Y + dy); + pcb_hidlib_crosshair_move_to(pcb_crosshair.X + dx, pcb_crosshair.Y + dy, 1); pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, pan_warp); PCB_ACT_IRES(0); Index: trunk/src/hidlib.h =================================================================== --- trunk/src/hidlib.h (revision 25335) +++ trunk/src/hidlib.h (revision 25336) @@ -50,8 +50,10 @@ void *pcb_hidlib_crosshair_suspend(void); void pcb_hidlib_crosshair_restore(void *susp_data); -/* Move the crosshair to an absolute x;y coord on the board and update the GUI */ -void pcb_hidlib_crosshair_move_to(pcb_coord_t abs_x, pcb_coord_t abs_y); +/* Move the crosshair to an absolute x;y coord on the board and update the GUI; + if mouse_mot is non-zero, the request is a direct result of a mouse motion + event */ +void pcb_hidlib_crosshair_move_to(pcb_coord_t abs_x, pcb_coord_t abs_y, int mouse_mot); /* The whole default menu file embedded in the executable; NULL if not present */ extern const char *pcb_hidlib_default_embedded_menu; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 25335) +++ trunk/src_plugins/hid_lesstif/main.c (revision 25336) @@ -505,7 +505,7 @@ pcb_notify_crosshair_change(pcb_false); if (panning) Pan(2, e->x, e->y); - pcb_event_move_crosshair(Px(e->x), Py(e->y)); + pcb_hidlib_crosshair_move_to(Px(e->x), Py(e->y), 1); pcb_hidlib_adjust_attached_objects(); pcb_notify_crosshair_change(pcb_true); in_move_event = 0; @@ -903,7 +903,7 @@ lesstif_pan_fixup(); if (setch) - pcb_hidlib_crosshair_move_to((x1+x2)/2, (y1+y2)/2); + pcb_hidlib_crosshair_move_to((x1+x2)/2, (y1+y2)/2, 0); } void zoom_by(double factor, pcb_coord_t x, pcb_coord_t y) @@ -1058,7 +1058,7 @@ in_move_event = 1; if (panning) Pan(2, pos_x, pos_y); - pcb_event_move_crosshair(Px(pos_x), Py(pos_y)); + pcb_hidlib_crosshair_move_to(Px(pos_x), Py(pos_y), 1); in_move_event = 0; } break; @@ -1075,7 +1075,7 @@ case EnterNotify: crosshair_in_window = 1; in_move_event = 1; - pcb_event_move_crosshair(Px(e->xcrossing.x), Py(e->xcrossing.y)); + pcb_hidlib_crosshair_move_to(Px(e->xcrossing.x), Py(e->xcrossing.y), 1); ShowCrosshair(pcb_true); in_move_event = 0; need_redraw = 1; Index: trunk/src_plugins/hid_lesstif/netlist.c =================================================================== --- trunk/src_plugins/hid_lesstif/netlist.c (revision 25335) +++ trunk/src_plugins/hid_lesstif/netlist.c (revision 25336) @@ -213,7 +213,7 @@ PCB_PIN_LOOP(element); { if (strcmp(pin->Number, pname) == 0) { - pcb_hidlib_crosshair_move_to(pin->X, pin->Y); + pcb_hidlib_crosshair_move_to(pin->X, pin->Y, 0); free(ename); return; } Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.c =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 25335) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 25336) @@ -195,7 +195,7 @@ if (setch) { v->pcb_x = (x1+x2)/2; v->pcb_y = (y1+y2)/2; - pcb_hidlib_crosshair_move_to(v->pcb_x, v->pcb_y); + pcb_hidlib_crosshair_move_to(v->pcb_x, v->pcb_y, 0); } } Index: trunk/src_plugins/lib_gtk_hid/common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/common.c (revision 25335) +++ trunk/src_plugins/lib_gtk_hid/common.c (revision 25336) @@ -42,7 +42,7 @@ pcb_gtk_coords_event2pcb(&gport->view, event_x, event_y, &gport->view.pcb_x, &gport->view.pcb_y); - pcb_event_move_crosshair(gport->view.pcb_x, gport->view.pcb_y); + pcb_hidlib_crosshair_move_to(gport->view.pcb_x, gport->view.pcb_y, 1); } static void kbd_input_signals_connect(int idx, void *obj)