Recent

Author Topic: Gtk3 widgetset - call for testing  (Read 2132 times)

zeljko

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Gtk3 widgetset - call for testing
« on: April 28, 2026, 12:02:05 am »
Hello,                                                                                                                                                             

The GTK3 widgetset has had substantial work over the last months and                                                                                               
can now run real LCL applications on both X11 and Wayland.  Before any
move to make it the default GTK widgetset on Linux, more testing on                                                                                               
real-world projects would help a lot.                                                                                                                             
                                                                                                                                                                   
Please build Lazarus trunk with LCLWidgetType=gtk3, run your                                                                                                       
applications - ideally on both X11 and Wayland, and at HiDPI if
available - and file any regressions on GitLab:                                                                                                                   
                                                                                                                                                                   
    https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues                                                                                                     
                                                                                                                                                                   
Known TODO before GTK3 can be considered the default Linux widgetset:                                                                                             
                                                       
    - TTrayIcon (StatusNotifierItem + GtkStatusIcon fallback)                                                                                                     
    - Full MapMode / Set/GetWindow/ViewportExt/Org coverage
                                                                                                                                                                   
Many thanks to everyone who has reported issues so far.                                                                                                           

Regards,                                                                                                                                                           
Željan Rikalo  (zeljko)

Retrofoxed

  • Guest
Re: Gtk3 widgetset - call for testing
« Reply #1 on: April 28, 2026, 01:56:44 am »
Thank you so much for implementing GTK3! I have a few pretty big apps and get into GTK3 testing.

By the way, I have my own dual implementation of tray icon for Linux using D-Bus directly (plus Windows and macOS). As far as I remember I had some issues with the built-in Lazarus component, hence wrote my own.

So this one doesn't depend on libappindicator, which is commonly missing or broken and has the GTK fallback. Battle-tested and correctly handles a situation when the app starts on boot and SNI is not yet available. See the attachment and feel free to reuse that code.

440bx

  • Hero Member
  • *****
  • Posts: 6528
Re: Gtk3 widgetset - call for testing
« Reply #2 on: April 28, 2026, 06:01:22 am »
OT:

@Retrofoxed,

are you the retrofoxed who was Wallaby and later retrofoxed who worked on exception handling for ARM64 using A.I assistance ?
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Retrofoxed

  • Guest
Re: Gtk3 widgetset - call for testing
« Reply #3 on: April 28, 2026, 06:32:21 am »
@Retrofoxed,
are you the retrofoxed who was Wallaby and later retrofoxed who worked on exception handling for ARM64 using A.I assistance ?

Yes, same person. Deleted my old account due to spending too much time here, but kinda couldn't resist coming back :-)

440bx

  • Hero Member
  • *****
  • Posts: 6528
Re: Gtk3 widgetset - call for testing
« Reply #4 on: April 28, 2026, 11:29:25 am »
Yes, same person. Deleted my old account due to spending too much time here, but kinda couldn't resist coming back :-)
Welcome back.  I'm pleased you are here again... this means I intend to pick your brain again ;)
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

ccrause

  • Hero Member
  • *****
  • Posts: 1117
Re: Gtk3 widgetset - call for testing
« Reply #5 on: April 28, 2026, 12:01:58 pm »
The GTK3 widgetset has had substantial work over the last months and                                                                                               
can now run real LCL applications on both X11 and Wayland.

Count of GTK3 commits over the last year:
Code: Bash  [Select][+][-]
  1. $ git log --since  "1 year ago" | grep -i gtk3 | grep -c .
  2. 358

Very impressive! Almost a commit per day over a whole year. A big thank you Željan and other contributors.

Perhaps also update the wiki to indicate the required libraries.  I had to install libgtk-3-dev to link the IDE. It should have been obvious, but it took a couple of minutes to find out which library was missing.

Thaddy

  • Hero Member
  • *****
  • Posts: 19249
  • Glad to be alive.
Re: Gtk3 widgetset - call for testing
« Reply #6 on: April 28, 2026, 12:29:14 pm »
Just compiled. If anything found will report.
objects are fine constructs. You can even initialize them with constructors.

zeljko

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Gtk3 widgetset - call for testing
« Reply #7 on: April 28, 2026, 04:10:08 pm »
Perhaps also update the wiki to indicate the required libraries.  I had to install libgtk-3-dev to link the IDE. It should have been obvious, but it took a couple of minutes to find out which library was missing.

Added libgtk3-dev to the wiki. Thanks.

Aruna

  • Hero Member
  • *****
  • Posts: 807
Re: Gtk3 widgetset - call for testing
« Reply #8 on: April 28, 2026, 04:12:10 pm »
Hi zeljko,

I am running Debian with gnome classic most times.  I just compiled Lazarus IDE with gtk3 it built with no issues. What I have noticed in the initial testing and exploration are:

1 - If you create a new project-->Application then try to drag the form using the caption bar it gives you two caption bars. Screenshot attached.
2 - It does not seem to instantly update the form when I change the background color like it used to with gtk2. Thks is at design time. On running it does honor the color change.
3 - I was pleaseantly surprised when I tried to change the background color of a TEdit and it did just that. TMemo also changes color when asked. Though I love this is it not controlled by teh widget 
     set and OS?

I will keep you all posted with any other surprises I may find. The check box arrows light blue background with a thick check mark in the object inspector I did not much like but then that could be because I am so used to gtk2.
« Last Edit: April 28, 2026, 04:13:47 pm by Aruna »

zeljko

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Gtk3 widgetset - call for testing
« Reply #9 on: April 28, 2026, 05:33:45 pm »
Hi zeljko,

I am running Debian with gnome classic most times.  I just compiled Lazarus IDE with gtk3 it built with no issues. What I have noticed in the initial testing and exploration are:

1 - If you create a new project-->Application then try to drag the form using the caption bar it gives you two caption bars. Screenshot attached.
2 - It does not seem to instantly update the form when I change the background color like it used to with gtk2. Thks is at design time. On running it does honor the color change.
3 - I was pleaseantly surprised when I tried to change the background color of a TEdit and it did just that. TMemo also changes color when asked. Though I love this is it not controlled by teh widget 
     set and OS?

I will keep you all posted with any other surprises I may find. The check box arrows light blue background with a thick check mark in the object inspector I did not much like but then that could be because I am so used to gtk2.

1-Definitelly cannot reproduce on my system, haven't tested on Gnome classic, I'm using KDE Plasma x11 on Mint 22.3, and XFCE x11 on Mint 20.03.
2-Looks like a bug.
3.Yes, it can be controlled because gtk3 uses GtkStyleContext (css), not gtk2 GtkStyle, so it was easy to control text input controls. Hence, I did not touch TButton/TBitBtn button yet , so color cannot be changed there atm - it uses theme color.

Thanks for testing.

zeljko

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Gtk3 widgetset - call for testing
« Reply #10 on: April 28, 2026, 07:17:20 pm »
2 - It does not seem to instantly update the form when I change the background color like it used to with gtk2. Thks is at design time. On running it does honor the color change.

Fixed, https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/13b3b4e62d138ca0425655f8a4be8a305c94debe

Aruna

  • Hero Member
  • *****
  • Posts: 807
Re: Gtk3 widgetset - call for testing
« Reply #11 on: April 28, 2026, 08:04:21 pm »
2 - It does not seem to instantly update the form when I change the background color like it used to with gtk2. Thks is at design time. On running it does honor the color change.

Fixed, https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/13b3b4e62d138ca0425655f8a4be8a305c94debe
Thank you. Wow, that has to be one of the fastest fixes from time of reporting the bug  (if not the fastest ). I checked again using xfce and you are right. Absolutely no double caption issues and quite a bit snappier as well.  I will keep testing and if I find anything interesting will report back. css once you get things stabilized I can't wait to build a UI that has all the bells and whistles :)

Retrofoxed

  • Guest
Re: Gtk3 widgetset - call for testing
« Reply #12 on: April 29, 2026, 05:17:47 am »
Thank you. Wow, that has to be one of the fastest fixes from time of reporting the bug  (if not the fastest ). I checked again using xfce and you are right. Absolutely no double caption issues and quite a bit snappier as well.  I will keep testing and if I find anything interesting will report back. css once you get things stabilized I can't wait to build a UI that has all the bells and whistles :)

I can sense the presence of an AI, likely Claude CLI from the style of comments and commit messages. No judgement - I use one too, it's a great productivity boost!  :)

dbannon

  • Hero Member
  • *****
  • Posts: 3823
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Gtk3 widgetset - call for testing
« Reply #13 on: April 29, 2026, 02:03:43 pm »
Thank you so much for implementing GTK3! I have a few pretty big apps and get into GTK3 testing.

By the way, I have my own dual implementation of tray icon for Linux using D-Bus directly (plus Windows and macOS). As far as I remember I had some issues with the built-in Lazarus component, hence wrote my own.

So this one doesn't depend on libappindicator, which is commonly missing or broken and has the GTK fallback. Battle-tested and correctly handles a situation when the app starts on boot and SNI is not yet available. See the attachment and feel free to reuse that code.

Oh, wow, now I am interested !

Time permitting, will run some tests !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1285
Re: Gtk3 widgetset - call for testing
« Reply #14 on: May 05, 2026, 10:28:20 pm »
I am using Lazarus BIGIDE Trunk to test LCL-GTK3 on Zorin OS 18.1 (based on Ubuntu 24.04 LTS Noble Numbat and Debian 13 Trixie).

Code: Bash  [Select][+][-]
  1. $ ./lazarus --pcp=~/lazarus_trunk/.lazarus_trunk &
  2.  
  3. $ SetPrimaryConfigPath NewValue="~/lazarus_trunk/.lazarus_trunk" expanded to "/home/valdir/lazarus_trunk/.lazarus_trunk"
  4.  
  5. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/valdir/lazarus_trunk/.lazarus_trunk"
  6. Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
  7. Gdk-Message: 04:36:53.714: Window 0x19634dd0 is a temporary window without parent, application will not be able to position it on screen.
  8.  
  9. Hint: [TPCTargetConfigCache.Update] has changed
  10. Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux--gtk3 New=x86_64-linux--gtk3 Changed: OS/CPU=True LCL=False
  11.  
  12. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.865: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  13.  
  14. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.865: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  15.  
  16. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.866: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
  17.  
  18. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.867: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  19.  
  20. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.867: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  21.  
  22. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.986: gtk_distribute_natural_allocation: assertion 'extra_space >= 0' failed
  23.  
  24. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.988: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  25.  
  26. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.988: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  27.  
  28. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.989: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  29.  
  30. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.990: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  31.  
  32. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.991: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  33.  
  34. (lazarus:66718): Gtk-CRITICAL **: 04:37:28.991: gtk_box_gadget_distribute: assertion 'size >= 0' failed in LCLGtkNotebook
  35.  
  36. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  37. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  38.  
  39. Hint: (lazarus) [TPkgManager.AddUnitDepsForCompClasses] Extending Uses unit1.pas StdCtrls
  40.  
  41. [TEventsCodeTool.CompleteComponent] ADDING variable Label1:TLabel
  42. [TEventsCodeTool.CompleteComponent] ADDING variable Button1:TButton
  43. [TEventsCodeTool.CompleteComponent] ADDING variable Button2:TButton
  44. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  45. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  46. [TEventsCodeTool.CompleteComponent] ADDING variable Edit1:TEdit
  47. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  48. [TEventsCodeTool.CompleteComponent] ADDING variable Edit2:TEdit
  49. WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
  50. Hint: (lazarus) [TMainIDE.DoRunProjectWithDebug] INIT
  51. Hint: (lazarus) Project needs building: SrcFile outdated Project
  52. Info: (lazarus) Execute Title="Compile Project, Target: /home/valdir/tmp/project1"
  53. Info: (lazarus) Working Directory="/home/valdir/tmp/"
  54. Info: (lazarus) Executable="/usr/bin/fpc"
  55. Info: (lazarus) Param[0]="-MObjFPC"
  56. Info: (lazarus) Param[1]="-Scghi"
  57. Info: (lazarus) Param[2]="-Cg"
  58. Info: (lazarus) Param[3]="-O1"
  59. Info: (lazarus) Param[4]="-gw3"
  60. Info: (lazarus) Param[5]="-gl"
  61. Info: (lazarus) Param[6]="-l"
  62. Info: (lazarus) Param[7]="-vewnhibq"
  63. Info: (lazarus) Param[8]="-Fi/home/valdir/tmp/lib/x86_64-linux"
  64. Info: (lazarus) Param[9]="-Fu/home/valdir/lazarus_trunk/lcl/units/x86_64-linux/gtk3"
  65. Info: (lazarus) Param[10]="-Fu/home/valdir/lazarus_trunk/lcl/units/x86_64-linux"
  66. Info: (lazarus) Param[11]="-Fu/home/valdir/lazarus_trunk/components/freetype/lib/x86_64-linux"
  67. Info: (lazarus) Param[12]="-Fu/home/valdir/lazarus_trunk/components/lazutils/lib/x86_64-linux"
  68. Info: (lazarus) Param[13]="-Fu/home/valdir/lazarus_trunk/packager/units/x86_64-linux"
  69. Info: (lazarus) Param[14]="-FU/home/valdir/tmp/lib/x86_64-linux/"
  70. Info: (lazarus) Param[15]="-FE/home/valdir/tmp/"
  71. Info: (lazarus) Param[16]="-o/home/valdir/tmp/project1"
  72. Info: (lazarus) Param[17]="-dLCL"
  73. Info: (lazarus) Param[18]="-dLCLgtk3"
  74. Info: (lazarus) Param[19]="/home/valdir/tmp/project1.lpr"
  75. Info: (lazarus) [TCompiler.Compile] end
  76. Hint: (lazarus) [TMainIDE.DoBuildProject] compiler time in s: 2,59600030258298
  77. Info: (lazarus) [TMainIDE.DoBuildProject] Success
  78. Hint: (lazarus) [TMainIDE.DoRunProjectWithDebug] Debugger=TFpDebugDebugger
  79. Hint: (lazarus) [TMainIDE.DoRunProjectWithDebug] END
  80. TGtk3WSCommonDialog.DestroyHandle
  81. Info: (lazarus) [SaveProjectInfo] ShowSaveProjectAsDialog failed
  82. Info: (lazarus) [SaveProject] SaveProjectInfo failed
  83. LAZARUS END - cleaning up ...
  84. FreeFormEditor: FormEditor1=TFormEditor
  85. Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
  86. Hint: (lazarus) [TMainIDE.Destroy] END


Lazarus messages on compiling a very simples LCL-GTK3 project with 2 labels, 2 edits and 2 buttons:

Code: Pascal  [Select][+][-]
  1. Hint: (11030) Start of reading config file /etc/fpc.cfg
  2. Hint: (11031) End of reading config file /etc/fpc.cfg
  3. Free Pascal Compiler version 3.2.2 [2021/07/09] for x86_64
  4. Copyright (c) 1993-2021 by Florian Klaempfl and others
  5. (1002) Target OS: Linux for x86-64
  6. (3104) Compiling /home/valdir/tmp/project1.lpr
  7. (3104) Compiling unit1.pas
  8. (9022) Compiling resource /home/valdir/tmp/lib/x86_64-linux/project1.or
  9. (9015) Linking /home/valdir/tmp/project1
  10. /home/valdir/tmp/project1.lpr(27,1) Warning: (9034) "crtbeginS.o" not found, this will probably cause a linking failure
  11. /home/valdir/tmp/project1.lpr(27,1) Warning: (9034) "crtendS.o" not found, this will probably cause a linking failure
  12. (1008) 63 lines compiled, 2.4 sec
  13. (1021) 2 warning(s) issued
  14. (1022) 2 hint(s) issued


Zorin Os 18.1 is using GNOME 46.7 on Wayland.

Even after saving the settings, the IDE always starts with the windows centered and overlapping, as shown in the attached images.

It's a minor annoyance to rearrange these windows, but it doesn't interfere with the rest of my work each day.

The small projects I've tested so far also start centered even when they shouldn't, but then they work normally.

 

TinyPortal © 2005-2018