Recent

Author Topic: [Solved] GetWindowManager value is wrong  (Read 2035 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2479
    • UVviewsoft
[Solved] GetWindowManager value is wrong
« on: August 23, 2023, 11:36:25 am »
I made small demo to see GetWindowManager result string. It gives string of 6-7 Chinese symbols here in the demo! Why? I use latin Ubuntu 20.04 x64 with Gnome.
Code: Pascal  [Select][+][-]
  1. implementation
  2.  
  3. uses gtk2int;
  4.  
  5. {$R *.lfm}
  6.  
  7. { TForm1 }
  8.  
  9. procedure TForm1.FormCreate(Sender: TObject);
  10. begin
  11.   caption:= 'wm: '+GTK2WidgetSet.GetWindowManager;
  12. end;    
  13.  

Lazarus 3.99 (rev main_3_99-33-gcb65d62758) FPC 3.2.3 x86_64-linux-gtk2
« Last Edit: August 24, 2023, 09:32:10 am by AlexTP »

zeljko

  • Hero Member
  • *****
  • Posts: 1668
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK2WidgetSet.GetWindowManager value is wrong
« Reply #1 on: August 23, 2023, 03:03:11 pm »
I've maded change of wm name yesterday in trunk, changed PWideChar to PChar ... can you check inside GetWindowManager if PWideChar need to be returned back ?

zeljko

  • Hero Member
  • *****
  • Posts: 1668
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK2WidgetSet.GetWindowManager value is wrong
« Reply #2 on: August 23, 2023, 03:10:21 pm »
Juha created bug with https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/db2bca39494aed99664abf76990a26a635e8beb4 , 3 months ago, I've fixed it yesterday, also added to merge list for 3.0RC2.

AlexTP

  • Hero Member
  • *****
  • Posts: 2479
    • UVviewsoft
Re: GTK2WidgetSet.GetWindowManager value is wrong
« Reply #3 on: August 23, 2023, 04:14:53 pm »
I used not last Lazarus! If I change PWideChar() to PChar(), then I get OK name 'gnome shell'.
Must be in .GetWindowManager:

Code: [Select]
            if (typeReturned = WMAtom) and (formatReturned = 8) then
              Result := LowerCase(StrPas(PChar(Data)));

zeljko

  • Hero Member
  • *****
  • Posts: 1668
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK2WidgetSet.GetWindowManager value is wrong
« Reply #4 on: August 23, 2023, 06:17:22 pm »
As I sad it's fixed yesterday and merged to fixes_3_0

 

TinyPortal © 2005-2018