When I use RunScript to run a command from an eto button, and the command uses a GetPoint or GetObject, I have to click on the viewport to “activate” it, before I can begin to select points or objects. However, this does not occur, for example, when picking points for Rhino’s own Focal Blur > select Focal Distance button:
When you see the cursor switch from the “hand” cursor to crosshairs, that is the point where I have clicked on the viewport. This can be reproduced with even the most trivial command:
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
new GetPoint().Get();
return Result.Cancel;
}
The issue does not occur when running the command directly from the command-line, only when using RunScript from the eto event handler. I am testing this on win10, 7.8.21196.5001, 2021-07-15.
I have not yet found anything in the docs (or the forum) that speaks to this, and have tried random things like pointlessly calling RunScript from within an InvokeOnUiThread, or calling RhinoApp.SetFocusToMainWindow(doc) from within the event handler or the command itself, just to see if there might be any difference, but have not detected any. I have also tried running the command with dash and/or bang prefix, with echo set to true & false, and any other combination of things I can think of, with no apparent change.
As visible in the video, it just looks like things start out well, with the expected crosshair cursor being shown, and then focus is grabbed by the panel, main window, or other UI, as soon as the cursor is moved at all, at which point the cursor switches to the hand cursor, and mouse movement over a viewport does not register in the viewport until after clicking somewhere on it.
So I will appreciate any hints or direction on this.