Skip to content

Commit

Permalink
better implementation of cursor reconfiguring if draw_crosshair enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanSchippers committed Sep 29, 2023
1 parent c25a9f9 commit 05c79fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/xschem.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 05c79fe

Please sign in to comment.