better implementation of cursor reconfiguring if draw_crosshair enabled

This commit is contained in:
stefan schippers 2023-09-30 00:22:10 +02:00
parent c25a9f9d85
commit 05c79febc2
2 changed files with 5 additions and 4 deletions

View File

@ -1144,12 +1144,13 @@ int rstate; /* (reduced state, without ShiftMask) */
switch(event)
{
case LeaveNotify:
draw_crosshair(1);
if(draw_xhair) draw_crosshair(1);
tclvareval(xctx->top_path, ".drw configure -cursor {}" , NULL);
xctx->mouse_inside = 0;
break;
case EnterNotify:
xctx->mouse_inside = 1;
if(tclgetboolvar("draw_crosshair"))
if(draw_xhair)
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
else
tclvareval(xctx->top_path, ".drw configure -cursor {}" , NULL);

View File

@ -5765,7 +5765,7 @@ global env has_x OS autofocus_mainwindow
bind $topwin <Leave> "
xschem callback %W %T %x %y 0 0 0 %s
graph_show_measure stop
$topwin configure -cursor {}
# $topwin configure -cursor {}
"
bind $topwin <Expose> "xschem callback %W %T %x %y 0 %w %h %s"
bind $topwin <Double-Button-1> "xschem callback %W -3 %x %y 0 %b 0 %s"
@ -5779,7 +5779,7 @@ global env has_x OS autofocus_mainwindow
if {$autofocus_mainwindow} {
bind $topwin <Motion> "focus $topwin; xschem callback %W %T %x %y 0 0 0 %s"
bind $topwin <Enter> "
if {\$draw_crosshair} {$topwin configure -cursor none}
# if {\$draw_crosshair} {$topwin configure -cursor none}
destroy .ctxmenu
focus $topwin
xschem callback %W %T %x %y 0 0 0 0