further fix previous regression

This commit is contained in:
stefan schippers 2024-03-03 04:21:49 +01:00
parent 54e446dbc2
commit 55ac6bb396
5 changed files with 8 additions and 7 deletions

View File

@ -1234,6 +1234,7 @@ int rstate; /* (reduced state, without ShiftMask) */
xctx->mouse_inside = 0;
break;
case EnterNotify:
dbg(2, "callback(): Enter event sel_or_clip=%s, ui_state=%d\n", sel_or_clip, xctx->ui_state);
xctx->mouse_inside = 1;
if(draw_xhair)
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
@ -1242,7 +1243,7 @@ int rstate; /* (reduced state, without ShiftMask) */
/* xschem window *sending* selected objects
when the pointer comes back in abort copy operation since it has been done
in another xschem xctx->window; STARTCOPY set and selection file does not exist any more */
if( stat(sel_or_clip, &buf) && (xctx->ui_state & STARTCOPY) )
if(stat(sel_or_clip, &buf) && (xctx->ui_state & STARTCOPY) )
{
copy_objects(ABORT); /* also unlinks sel_or_flip file */
unselect_all(1);
@ -1253,8 +1254,7 @@ int rstate; /* (reduced state, without ShiftMask) */
}
/*xschem window *receiving* selected objects
* no selected objects and selection file exists --> start merge */
if(xctx->lastsel == 0 && !stat(sel_or_clip, &buf)) {
dbg(2, "callback(): Enter event\n");
if(xctx->lastsel == 0 && !stat(sel_or_clip, &buf)) {
xctx->mousex_snap = 490;
xctx->mousey_snap = -340;
merge_file(1, ".sch");

View File

@ -939,6 +939,7 @@ void move_objects(int what, int merge, double dx, double dy)
{
int firsti, firstw;
xunlink(sel_or_clip);
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
/* no undo push for MERGE ad PLACE and polygon point drag, already done before */

View File

@ -330,8 +330,6 @@ void merge_file(int selection_load, const char ext[])
my_snprintf(name, S(name), "%s/.clipboard.sch", user_conf_dir);
}
my_snprintf(sel_or_clip, S(sel_or_clip), name);
if(is_generator(name)) generator = 1;
if(generator) {

View File

@ -4888,8 +4888,6 @@ void save_selection(int what)
else /* what=2 */
my_snprintf(name, S(name), "%s/%s.sch",user_conf_dir , ".clipboard");
my_snprintf(sel_or_clip, S(sel_or_clip), name);
if(!(fd=fopen(name,"w")))
{
fprintf(errfp, "save_selection(): problems opening file %s \n", name);

View File

@ -6227,6 +6227,10 @@ proc context_menu { } {
wm geometry .ctxmenu "+$x+$y";# move away from screen edges
bind .ctxmenu <Leave> {if { {%W} eq {.ctxmenu} } {destroy .ctxmenu}}
tkwait window .ctxmenu
# when context menu is destroyed an EnterNotify event is generated in the
# main xschem window. We want to process this event before taking
# actions based on $retval.
update
return $retval
}