11unit UMain;
2-
3- // {$mode objfpc}{$H+}
4- // EnableBlur procedure requires delphi mode.
5- { $mode delphi}
6-
72{
83### Source:
94 https://github.com/torum/Image-viewer
4338* more Command line options.
4439}
4540
41+ // EnableBlur procedure requires delphi mode.
42+ // {$mode objfpc}{$H+}
43+ { $mode delphi}
44+
4645interface
4746
4847uses
@@ -305,7 +304,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
305304 i,f:integer;
306305 configFile:string;
307306begin
308- FstrAppVer:=' 1.3.9.0 ' ;
307+ FstrAppVer:=' 1.3.9.2 ' ;
309308
310309 // Init Main form properties.
311310 self.Caption:=ReplaceStr(ExtractFileName(ParamStr(0 )),ExtractFileExt(ParamStr(0 )),' ' );
@@ -1214,9 +1213,7 @@ procedure TfrmMain.TimerEffectStartTimer(Sender: TObject);
12141213 // We start with fullscreen, so close after fullscreen.
12151214 close;
12161215 end ;
1217-
12181216 end ;
1219-
12201217end ;
12211218
12221219procedure TfrmMain.TimerDelayStartTimer (Sender: TObject);
@@ -1712,9 +1709,9 @@ procedure TfrmMain.MenuItemSlideshowInFrameClick(Sender: TObject);
17121709 { $else}
17131710 // https://forum.lazarus.freepascal.org/index.php?topic=38675.0
17141711 FOrigBounds:= BoundsRect;
1715- Hide;
1712+ // Hide; // This started to cause an error since Ubuntu 24.04.
17161713 self.BorderStyle:=bsNone;
1717- Show;
1714+ // Show; // This started to cause an error since Ubuntu 24.04.
17181715
17191716 Form := TForm.Create(nil );
17201717 try
@@ -1862,8 +1859,8 @@ procedure TfrmMain.SetCaption(strCaption:string);
18621859
18631860procedure TfrmMain.SetStayOnTop (bln:Boolean);
18641861{ $ifdef windows}
1865- // var
1866- // BeforeBounds : TRect;
1862+ var
1863+ BeforeBounds : TRect;
18671864{ $endif}
18681865begin
18691866 if bln then
@@ -1878,37 +1875,38 @@ procedure TfrmMain.SetStayOnTop(bln:Boolean);
18781875 { $ifdef windows}
18791876 if FisInFrame then
18801877 begin
1881- // TODO: This is not working...
1882-
18831878 // "FormStyle:=fsNormal" causes window pos to move to 0,0 so..
1884- // BeforeBounds:= BoundsRect;
1879+ BeforeBounds:= BoundsRect;
18851880
1886- // This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works ...
1887- // self.FormStyle:=fsNormal;
1881+ // This isn't working for windows... calling this(FormStyle:=fsNormal) twice seems to work but ...
1882+ self.FormStyle:=fsNormal;
18881883
1889- // MenuItemStayOnTop.Checked:=false;
1890- // self.FoptStayOnTop:=false;
1884+ MenuItemStayOnTop.Checked:=false;
1885+ self.FoptStayOnTop:=false;
18911886
18921887 if FisStartNormal then
18931888 begin
1894- // self.BorderStyle:=bsNone;
1889+ self.BorderStyle:=bsNone; // Forgot what this was for. Why did I put this here?
18951890 end ;
1891+
1892+ // Needed to this HERE again.... I don't know why.
1893+ self.FormStyle:=fsNormal;
1894+
18961895 // Blur again
1897- // DoubleBuffered := True;
1898- // EnableBlur;
1896+ DoubleBuffered := True;
1897+ EnableBlur;
1898+
18991899 // re-set position.
1900- // BoundsRect := BeforeBounds;
1900+ BoundsRect := BeforeBounds;
19011901 end else
19021902 begin
1903- // This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works...
19041903 self.FormStyle:=fsNormal;
19051904
19061905 MenuItemStayOnTop.Checked:=false;
19071906 self.FoptStayOnTop:=false;
19081907 end ;
19091908
19101909 { $else}
1911- // This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works...
19121910 self.FormStyle:=fsNormal;
19131911
19141912 MenuItemStayOnTop.Checked:=false;
0 commit comments