Recent

Author Topic: GTK3, Lazarus - stable? and questions about QT.  (Read 1647 times)

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
GTK3, Lazarus - stable? and questions about QT.
« on: February 23, 2026, 10:11:20 am »
Hi!

Я хотел узнать, на каких версиях Lazarus более-менее стабильно работает набор виджетов GTK3? На одном из установленных мной FPC/Lazarus мои демки работают, а на другом, уже нет отображения.
В соседнем топике я писал, что использую для демок XID окна (Linux).

Так же я хотел узнать, как можно получить XID окна в QT? Если кто знает.

--------------------------------
Google translate:
I wanted to know on which versions of Lazarus the GTK3 widget set works more or less stably? My demos work on one of the FPC/Lazarus versions I installed, but on another, they don't display.
In a neighboring topic I wrote that I use XID windows (Linux) for demos.

I also wanted to know how to get a window's XID in QT? If anyone knows.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

salvadordf

  • Jr. Member
  • **
  • Posts: 77
    • BriskBard
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #1 on: February 23, 2026, 11:21:55 am »
In a neighboring topic I wrote that I use XID windows (Linux) for demos.
I also wanted to know how to get a window's XID in QT? If anyone knows.

I'm not an expert in QT but this is how I get the XID in the CEF4Delphi project:
https://github.com/salvadordf/CEF4Delphi/blob/0b6db7db30f83370aec73eab02c7668fb1b41e03/source/uCEFWindowInfoWrapper.pas#L540

I also had to set some attributes because CEF requires a native widget:
https://github.com/salvadordf/CEF4Delphi/blob/0b6db7db30f83370aec73eab02c7668fb1b41e03/source/uCEFWinControl.pas#L128
« Last Edit: February 23, 2026, 11:23:45 am by salvadordf »
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #2 on: February 23, 2026, 12:55:05 pm »
Hi!

Я хотел узнать, на каких версиях Lazarus более-менее стабильно работает набор виджетов GTK3? На одном из установленных мной FPC/Lazarus мои демки работают, а на другом, уже нет отображения.
В соседнем топике я писал, что использую для демок XID окна (Linux).

Так же я хотел узнать, как можно получить XID окна в QT? Если кто знает.

--------------------------------
Google translate:
I wanted to know on which versions of Lazarus the GTK3 widget set works more or less stably? My demos work on one of the FPC/Lazarus versions I installed, but on another, they don't display.
In a neighboring topic I wrote that I use XID windows (Linux) for demos.

I also wanted to know how to get a window's XID in QT? If anyone knows.

Basically: QWidget_winID(TQtWidget(YourControl.Handle).Widget) gives to you native handle (XID under x11, HWND under windows).

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #3 on: February 23, 2026, 01:23:50 pm »
salvadordf, zeljko, thanks! It works.

Разработчикам Lazarus. Самая стабильная версия на данный момент для GTK3, это Lazarus 4.99. Только проблема в том, что пересобранный Lazarus под GTK3 не очень хорошо выглядит, но работает лучше чем все предыдущие версии (самую последнюю, которую проверял до этого, это версия 4.7).

Google translate:
To the Lazarus developers. The most stable version currently available for GTK3 is Lazarus 4.99. The only problem is that the rebuilt Lazarus for GTK3 doesn't look very good, but it works better than all previous versions (the most recent one I tested was 4.7).

My system: Debian 13, Cinnamon, X11.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #4 on: February 23, 2026, 02:54:56 pm »
Check gtk3 lazarus trunk, anchordocked IDE + dockedformeditor works, well, there are still things todo about dockedformeditor but it does not crash anymore.

dbannon

  • Hero Member
  • *****
  • Posts: 3777
    • tomboy-ng, a rewrite of the classic Tomboy
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #5 on: February 24, 2026, 09:33:39 am »
Cool progress !
Are you looking for UI bug reports or still working on your own list of bugs ?

eg (confirmed gtk3 only)
  • (strange one) typing the letter 'o' into the Tools-Options search box closes the dialog.
  • Open recent project at startup does not work, while you can select the desired project name in the dropdown combo, it does not load that project. Browsing to project after "Open Project" works ok.


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: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #6 on: February 24, 2026, 10:26:05 am »
Cool progress !
Are you looking for UI bug reports or still working on your own list of bugs ?

eg (confirmed gtk3 only)
  • (strange one) typing the letter 'o' into the Tools-Options search box closes the dialog.
  • Open recent project at startup does not work, while you can select the desired project name in the dropdown combo, it does not load that project. Browsing to project after "Open Project" works ok.


Davo

I'm actually trying to fix exactly that issue :) , find dialog, tools options search box, etc have exactly the same problem. A lot of debugging is in progress ...

dbannon

  • Hero Member
  • *****
  • Posts: 3777
    • tomboy-ng, a rewrite of the classic Tomboy
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #7 on: February 24, 2026, 11:08:52 am »
I'm actually trying to fix exactly that issue :) , find dialog, tools options search box, etc have exactly the same problem. A lot of debugging is in progress ...
:D
And we appreciate your efforts !
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

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #8 on: February 24, 2026, 12:04:04 pm »
zeljko, если это чем-нибудь поможет. На первом снимке GTK2, на втором GTK3. Компонент TPaintBox.
При этом, на форме, когда выбираешь этот TPaintBox, его разметка отображается ниже (захват его отображается ниже, а вид его прежним остаётся).

Если рассматривать сам Lazarus, то в редакторе кода, когда компилируешь и выдаёт ошибку, то "появляется" новая вкладка, которая перекрывает старую и на месте нового файла нет ни какого изображения (даже перелистывания страниц не отображается, но если на них навестись и щёлкнуть, то они "работают"). У меня ошибка была в файле конфигурации (*.cfg), а не файле "*.pas".

Google translate:
zeljko, if this helps. The first picture is GTK2, the second is GTK3. The TPaintBox component.
Moreover, on the form, when you select this TPaintBox, its markup is displayed below (its capture is displayed below, but its appearance remains the same).

If we look at Lazarus itself, then in the code editor, when you compile and it gives an error, a new tab “appears” that overlaps the old one and there is no image in place of the new file (not even page turning is displayed, but if you hover over them and click, they “work”). I had an error in the configuration file (*.cfg), not the "*.pas" file.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #9 on: February 24, 2026, 02:42:43 pm »
Try to get xid of toplevel in gtk3 maybe ? I really don't know how to help you atm.

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #10 on: February 24, 2026, 03:24:54 pm »
zeljko, я думал вам это может чем-то помочь.  :) Это проблема именно LCL-компонентов, а не та, с которой я столкнулся. Там где мне надо произвести вывод, у меня стандартный вывод работает (правое верхнее окно с чёрным фоном). Похоже, что именно LCL компоненты не знаю своего местоположения.

Google translate:
zeljko, I thought this might help you. :) This is a problem with LCL components specifically, not the one I encountered. Where I need to output, standard output works (the upper-right window with a black background). It seems that the LCL components themselves don't know their location.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: GTK3, Lazarus - stable? and questions about QT.
« Reply #11 on: February 25, 2026, 07:58:10 pm »
Если это чем-то вам поможет.
В GTK2 TPaintBox, процедура Paint вызывается дважды и далее, при работе приложения, находится в режиме ожидания (правильно).
В GTK3 эта же процедура вызывается каждый кадр.
В QT6 - TPaintBox (на рабочем приложении) не отображается совсем (возможно вообще за пределами формы отображается?).

GTK3. При использовании компонента CheckBox, если ему выставить свойство Checked = true, и при этом определено свойство OnChange, то процедура CheckBoxChange сработает раньше активации окна (процедура FormActivate).

Google translate:
If this helps you in any way.
In GTK2, the TPaintBox procedure Paint is called twice and then remains idle while the application is running (right).
In GTK3, the same procedure is called every frame.
In QT6, the TPaintBox (in the running application) is not displayed at all (perhaps it is even displayed outside the form?).

GTK3. When using the CheckBox component, if you set the Checked = true property, and at the same time the OnChange property is defined, then the CheckBoxChange procedure will run before the window is activated (the FormActivate procedure).
« Last Edit: February 25, 2026, 08:22:10 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018