Skip to content

Commit

Permalink
focus on main window on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanb committed Jun 25, 2023
1 parent 0996351 commit 4ad3dae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tcl/main.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,16 @@ proc ipc {method args} {
}

proc windows_forcefocus {} {
# First call winapi's SetForegroundWindow()
set handle [winfo id .]
ipc "forcefocus" $handle
# Then call force focus on tcl side
focus -force .
# We must do both in order to properly focus on main tk window.
# Don't ask me why - that's just how it works.
#
# Alternatively we can try making Tcl our entrypoint instead of exec-ing
# Tcl from Go. Maybe some other time.
}

proc loadicon {} {
Expand Down

0 comments on commit 4ad3dae

Please sign in to comment.