Recent

Author Topic: Mint Cinnamon: Cannot show minimized form  (Read 307 times)

CM630

  • Hero Member
  • *****
  • Posts: 1313
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Mint Cinnamon: Cannot show minimized form
« on: March 23, 2025, 11:52:44 am »
The following code shows a minimized form on Windows.
In Linux Mint Cinnamon it does on the second time - the event which executes the code needs to be fired manually twice before the form is shown, after the first execution nothing happens

Code: Pascal  [Select][+][-]
  1.   self.WindowState := wsNormal;
  2.   self.Show;

Also, the following code works from the first time:
Code: Pascal  [Select][+][-]
  1.   self.WindowState := wsNormal;
  2.   self.Show;
  3.   ShowMessage ('');
  4.   self.Show;

The following code improves nothing:
Code: Pascal  [Select][+][-]
  1.   self.WindowState := wsNormal;
  2.   self.Show;
  3.   spleep(500);  
  4.   self.Show;

Any idea how to fix this? I have not tried those (non)syncronous things, if no better solution exists, I will try them.
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

Fred vS

  • Hero Member
  • *****
  • Posts: 3533
    • StrumPract is the musicians best friend
Re: Mint Cinnamon: Cannot show minimized form
« Reply #1 on: March 23, 2025, 01:32:08 pm »
Hello.

Mint-Cinnamon uses Muffin window manager (a fork of Mutter WM).
And it has features "by design" that are indeed not fully compatible like other working WM.
(And Muffin devs do not have plan to fix it).
« Last Edit: March 23, 2025, 01:39:32 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

CM630

  • Hero Member
  • *****
  • Posts: 1313
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Mint Cinnamon: Cannot show minimized form
« Reply #2 on: March 23, 2025, 06:15:00 pm »
But the ShowMessage sort of solves the issue, so probably I can emulate a ShowMessage, which shows nothing?
I will try with a timer.

EDIT:
I made it work the following way:
 :o
Code: Pascal  [Select][+][-]
  1. procedure TfrmMainForm.ShowApp;
  2. begin
  3.   self.WindowState := wsNormal;
  4.   self.Show;
  5.   self.BringToFront;
  6.   self.SetFocus;
  7.   {$IFDEF LINUX}
  8.   tmrTray.Enabled := True;
  9.   {$endif}
  10. end;
  11.  
  12. procedure TfrmMainForm.tmrTrayTimer(Sender: TObject);
  13. begin
  14.   //Used only in Linux, to override a bug in Mint Cinnamon
  15.   self.Show;
  16.   tmrTray.Enabled := False;
  17. end;  
« Last Edit: March 24, 2025, 05:23:11 pm by CM630 »
Лазар 4,0RC2 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018