I'm working with Lazarus 2.2.6 + dfsg2 - 2 + b1 on Linux (Kali Linux, 6.4.0-kali3-amd64, GTK2/3).
Problem description:
I have an application which opens one main form. It has a button which opens another form with a little calculator. When I start the application and press the calculator button all works fine: The calculator window is on top of the main window, the calculator has the focus and the mouse-pointer is on the calculator, too.
When I move the mouse-pointer out of the boundaries of the calculator and hover over the main window, this main window gets the focus and the calculator disappears behind the main window. And all this just by mouse-hovering!
Remarks:
On my Linux notebook I do not use the general focus on mouse-hover policy! I always click on windows to activate them. The behavior of the Lazarus program is exactly as if I had activated focus on mouse-hover, but I have not.
To mitigate the problem I have entered this procedure:
procedure TMeanCalculator.FormCreate(Sender: TObject);
begin
Self.formstyle := fsStayOnTop;
end;
But this only helps in so far as the calculator window does not disappear. The focus stealing problem is not solved by this.
What I want:
The problem should not occur at all! When the mouse-pointer leaves the calculator window nothing should happen as long as I do not click on anything else.
Question:
Is there a Lazarus option (which I could not find) or a hidden configuration item which prevents the problematic behavior? Can anyone explain possible reasons for this?
Thanks a lot, guys!