ShowSemiModal form not always on top

I display an Eto form for trimming a mesh with:

args = TrimMeshArgs()
dlg = TrimMeshDialog(args)
result = UI.EtoExtensions.ShowSemiModal(dlg, RhinoDoc.ActiveDoc, UI.RhinoEtoApp.MainWindow)

Then I do some mesh trimming and afterwards the form is sometime not on top. I can bring it to the top by selecting another application from the bottom tab in Windows 10 (like Chrome) and then collapsing it, but this is quite the bother.

Is there something I can code inside the script to bring the form back to the top after calling my trim_mesh procedure from within the form?

Regards,
Terry.

Hi @Terry_Chappell, you might try dlg.BringToFront(), but it should stay in focus without it if Rhino is shown. You might explicitely try to define an owner using

dlg.Owner = Rhino.UI.RhinoEtoApp.MainWindow 

before showing it. Btw. is it a Eto.Forms.Form or a Eto.Forms.Dialog ?

_
c.

It is defined with:

class TrimMeshDialog(forms.Dialog[bool])

so I guess it is an Eto.Forms.Dialog. Why do you ask?

Regards,
Terry.

Hi @Terry_Chappell, because i think that form behaves slightly different compared to dialog which has a return value when closed.

_
c.