Keeping focus on a form after launching a web page lazarus / 21-General ---------------------------------------------------------------------- MaxCuriosus · 2025-05-29 13:48 If, from a Form/Listbox, I open a web page with this procedure Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Procedure Open_URL(URL:String);Var  Process: TProcess;  I: Integer;Begin  Process:=TProcess.Create(nil);  try    Process.InheritHandles:=False;//  Process.Options:=[];        Process.Options:=[poDetached];    Process.ShowWindow:=swoShow;    for I:=1 to GetEnvironmentVariableCount do Process.Environment.Add(GetEnvironmentString(I));    Process.Executable:='xdg-open';    Process.Parameters.Add(URL);    Process.Execute;  finally    Process.Free;  end;end; the web page gets automatically the focus. I would like instead that the focus stays on the Form/Listbox. How can I do that? System   OS: Debian 12   Desktop: GNOME   Session: x11   Lararus/FPC: 2.2.4/3.2.2/gtk2 ---------------------------------------------------------------------- jamie · 2025-05-29 14:28 First of all, it's more readable if you put your code within a Code tag but that's fine for here since it wasn't over the top. You can try Application.BringToFront; which DOCS states it brings the last form to the front. do that at the end of your execution I guess.  If that does not work, use the OnDeactivate event for the form and the TAG value to be used as a flag so that you can then use the Show in that form once again to bring it back. ---------------------------------------------------------------------- MaxCuriosus · 2025-05-29 14:41 Code tag corrected/added. Will try what you suggested.