Recent

Author Topic: Lazarus IDE built for LCL-GTK3 is usable  (Read 4930 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4709
  • I like bugs.
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #15 on: March 05, 2026, 11:32:38 am »
Tested a it. Looks good. Page-tabs still need some work: see included screenshot Ubuntu 20.04 AMD64.
Here the component palette and other PageControls look better.
I have Manjaro Linux + KDE + X11. I didn't check the exact lib versions but Manjaro usually has the latest of everything.

Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #16 on: March 05, 2026, 11:35:26 am »
Zeljko, some advice please ?

In my app (not Lazarus) I see a problem where a thread cannot reliably get a handle to another form. So, a form that is about to exit, spins off a thread that asks for the handle to another form. It may work, it may crash (lots of Gtk3 messages below).

I believe that the problem is creating the handle, not using it.

I 'seem' to be able to fix the problem (for me) by getting a handle to the other form earlier (and not doing anything with it) in the closing form's code, not in the thread.

I cannot replicate this problem is a simple demo, indeed, changing a number of things in my app appears to help but it still happens. Code in question has been working fine in all other widget sets for some time.

When I step through the code, I hit a spot that completely locks up my session and requires me to login to another terminal and kill Lazarus.

Have you seen any issues like this, getting Form handles ?

When the error happens I see this in the console -
Code: Pascal  [Select][+][-]
  1. Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
  2. Bail out! Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
  3. **
  4. Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached
  5. Bail out! Gtk:ERROR:../../../gtk/gtkcssinheritvalue.c:33:gtk_css_value_inherit_free: code should not be reached

And when I try to get the handle (wether it works or not) I see -
Code: Pascal  [Select][+][-]
  1. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.993[0m: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
  2. (tomboy-ng:2234691): GLib-GObject-[1;33mWARNING[0m **: [34m19:50:52.993[0m: invalid unclassed pointer in cast to 'GObject'
  3. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.993[0m: g_object_freeze_notify: assertion 'G_IS_OBJECT (object)' failed
  4. (tomboy-ng:2234691): Gtk-[1;35mCRITICAL[0m **: [34m19:50:52.993[0m: gtk_widget_has_default: assertion 'GTK_IS_WIDGET (widget)' failed
  5. (tomboy-ng:2234691): Gtk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gtk_widget_get_receives_default: assertion 'GTK_IS_WIDGET (widget)' failed
  6. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: g_object_ref: assertion 'G_IS_OBJECT (object)' failed
  7. (tomboy-ng:2234691): Gtk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gtk_widget_get_display: assertion 'GTK_IS_WIDGET (widget)' failed
  8. (tomboy-ng:2234691): Gdk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gdk_display_get_device_manager: assertion 'GDK_IS_DISPLAY (display)' failed
  9. (tomboy-ng:2234691): Gdk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gdk_device_manager_list_devices: assertion 'GDK_IS_DEVICE_MANAGER (device_manager)' failed
  10. (tomboy-ng:2234691): Gdk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gdk_device_manager_list_devices: assertion 'GDK_IS_DEVICE_MANAGER (device_manager)' failed
  11. (tomboy-ng:2234691): Gdk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gdk_device_manager_list_devices: assertion 'GDK_IS_DEVICE_MANAGER (device_manager)' failed
  12. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  13. (tomboy-ng:2234691): GLib-GObject-[1;33mWARNING[0m **: [34m19:50:52.994[0m: invalid unclassed pointer in cast to 'GObject'
  14. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: g_object_notify: assertion 'G_IS_OBJECT (object)' failed
  15. (tomboy-ng:2234691): Gtk-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: gtk_widget_has_default: assertion 'GTK_IS_WIDGET (widget)' failed
  16. (tomboy-ng:2234691): GLib-GObject-[1;33mWARNING[0m **: [34m19:50:52.994[0m: invalid unclassed pointer in cast to 'GObject'
  17. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: g_object_thaw_notify: assertion 'G_IS_OBJECT (object)' failed
  18. (tomboy-ng:2234691): GLib-GObject-[1;35mCRITICAL[0m **: [34m19:50:52.994[0m: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

Looks pretty grim but we both know how wordy GTK is.

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

zeljko

  • Hero Member
  • *****
  • Posts: 1905
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #17 on: March 05, 2026, 03:28:13 pm »
@dbannon, I'm suspicious about your gtk3 version. Please write distro and version and gtk3 version.

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #18 on: March 05, 2026, 11:52:07 pm »
@dbannon, I'm suspicious about your gtk3 version. Please write distro and version and gtk3 version.

Debian Bookworm, ie 12, Mate

>$ pkg-config --modversion gtk+-3.0
3.24.38

FPC 324rc1

Lazarus Main, 2026-03-04
https://forum.lazarus.freepascal.org/Themes/default/images/bbc/bold.gif
Davo

EDIT:
  • Problem shows up only when run under the debugger, no debugger checks need be on.
  • Reliably 'fixed' if you make that early call to get the other window's handle before creating the thread that ultimately uses it. (Only the first call for a window's handle triggers its creation, as I am sure you know!).
       
« Last Edit: March 06, 2026, 01:34:59 am by dbannon »
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: 1225
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #19 on: March 07, 2026, 05:57:09 pm »
As some people noticed, GTK3 widgetset has advanced so that you can build the IDE with it and use it for real work.
Zeljko has made the docked IDE usable. The default non-docked IDE had one show-stopper, the MainBar height calculation went wrong and the component palette didn't show.
I added a temporary fix there and made a bug report.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/42083
Now it works at least on my X11 Linux system, I haven't tested with Wayland.

Please test. There are still plenty of bugs. If you report a bug, please make it specific and with example code.
Anyway thanks to Zeljko and some other contributors the recent improvements are huge. A functional IDE is a big milestone.
LCL-GTK3 will be the default in Lazarus 5.0 (whenever that happens).
Excellent information!
Thanks.

dsiders

  • Hero Member
  • *****
  • Posts: 1592
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #20 on: March 24, 2026, 02:34:05 am »
As some people noticed, GTK3 widgetset has advanced so that you can build the IDE with it and use it for real work.
Zeljko has made the docked IDE usable. The default non-docked IDE had one show-stopper, the MainBar height calculation went wrong and the component palette didn't show.
I added a temporary fix there and made a bug report.
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/42083
Now it works at least on my X11 Linux system, I haven't tested with Wayland.

Please test. There are still plenty of bugs. If you report a bug, please make it specific and with example code.
Anyway thanks to Zeljko and some other contributors the recent improvements are huge. A functional IDE is a big milestone.
LCL-GTK3 will be the default in Lazarus 5.0 (whenever that happens).

GTK3 Toolkit Winding Down To One Release Per Year
https://www.phoronix.com/news/GTK3-Annual-Release-Cadence

Tick, tick, tick...

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #21 on: March 24, 2026, 06:44:09 am »
GTK3 Toolkit Winding Down To One Release Per Year
https://www.phoronix.com/news/GTK3-Annual-Release-Cadence

Tick, tick, tick...
Actually, that might help. It will not be such a moving target, changing all the while.

As a matter of interest, I am about to send my alpha tester a Gtk3 version of tomboy-ng, has a few {ifdef}s and we choose to save in the main thread rather than a thread that does not annoy the user but pretty good as near as I can see.

Lazarus still has trouble rendering the Object Inspector. Both OI and Messages window, if you close and reopen, appear as zero (or close to zero) height and width but that is, apparently, gtk3 version sensitive. But that seems all that I can find wrong with it !

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

zeljko

  • Hero Member
  • *****
  • Posts: 1905
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #22 on: March 24, 2026, 12:42:12 pm »
That is not the case here. Testing docked IDE (actually using it all the time for gtk3 development) on Linux Mint 22.3 KDE Plasma x11, and jumping to weston for wayland tests inside separate terminal. For such tests always use latest lazarus trunk since things are rapidly changed as time goes on. I must have proper test case for your problem since I cannot reproduce it. On my older laptop I have Linux mint 20.03 with xfce and there I haven't spotted single problem with docked or undocked IDE (x11)

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #23 on: March 25, 2026, 12:49:45 am »
OK Zeljko, I'll set up some VMs ad see if I can see a pattern of when this problem shows up. I don't use dock'ed, do use debian bookworm, its possibly an older gtk3 ?

But your Linux Mint, 22.3 is Ubuntu 24.04 so about the same IMHO ???

Will be a day or two, traveling....

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

zeljko

  • Hero Member
  • *****
  • Posts: 1905
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #24 on: March 25, 2026, 09:51:07 am »
My other mint 20.03 is ubuntu 20.04 , so older gtk3 and it works w/o problems with both ide layouts.

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #25 on: March 25, 2026, 12:00:50 pm »

I have built a Linux Mint 22.3 Cinnamon VM. And can demonstrate the problem I mention.

Definitely relates to working non-docked. But lots of variations on Mint. You need to close lazarus by closing the project and then quitting the dialog. Then reopening Lazarus, open the previous project.

Sometimes it even works, but if you close the Object Inspector and reopen it, bad things. Even then, its a "sometimes". It might not open the OI window at all or it might open it with almost zero width and height. If it is a tiny window, you can pull it out to normal size and on Mint that works. On my bookworm, it is black screen. 

I have not yet tried any other Linux platforms.

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

dbannon

  • Hero Member
  • *****
  • Posts: 3775
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus IDE built for LCL-GTK3 is usable
« Reply #26 on: April 01, 2026, 08:57:25 am »
Above problem still exists but appars to have changed. Un-Docked. And even more confusedly.

On Linux Mint 22.3Cin, today's Lazarus main -
  • The message window shows and works correctly, but if you close it and reopen it, it reappears as a tiny block that can be grabbed and dragged out to size it should be. Then works OK.
  • The object inspector does not appear at startup, not even the tiny block. Poking it via the Lazarus View menu does nothing. The Window Manager does seem to think it is displaying the window however.


But on my Debian Bookworm, Mate I get (sort of) the reverse.
  • Object inspector appears OK at startup, closing and reopening it gets me the tiny block that can be grabbed and dragged, then works as normal.
  • Message window starts up showing previous screen buffer, close and reopen gives a tiny block, drag it out to a black window.


I see lots of messages on the console -
Code: [Select]
(lazarus:17210): Gtk-WARNING **: 17:44:47.376: Negative content width -7 (allocation 1, extents 4x4) while allocating gadget (node button, owner GtkButton)
....
(lazarus:17210): Gtk-CRITICAL **: 17:47:12.080: gtk_widget_map: assertion '_gtk_widget_get_child_visible (widget)' failed
WARNING: TGtk3ThemeServices.DrawElement: Drawing for element 19 not implemented.
....
(lazarus:17210): Gtk-CRITICAL **: 17:47:15.435: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Lots and lots of the last one !

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

 

TinyPortal © 2005-2018