Hello,
your sample application does not work on my System (Xubuntu 22.04.2 LTS 64 bit, Lazarus 2.2.4 FPC 3.2.2 x86_64-linux-gtk2).
After click on button1 the Window disappear.
I usually use
Form1.WindowState:=wsFullScreen;
to switch to full screen.
I also prefer the use of ActionList1. See attached example.
PS
My first Idea
private
FullScrn : boolean;
...
procedure TForm1.Action1Execute(Sender: TObject);
begin
if FullScrn then Form1.WindowState:=wsNormal
else
Form1.WindowState:=wsFullScreen;
FullScrn := not FullScrn;
did not work well. I had to call Action1Execute three times to switch back to normal Screen
private
FullScrn : boolean;
...
procedure TForm1.Action1Execute(Sender: TObject);
begin
Form1.WindowState:=wsFullScreen;
if FullScrn then Form1.WindowState:=wsNormal;
FullScrn := not FullScrn;