Recent

Author Topic: Lazarus in wayland QT6 Plasma 6.6.3  (Read 3000 times)

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Lazarus in wayland QT6 Plasma 6.6.3
« on: March 24, 2026, 08:42:45 am »
I know this has been discussed before and there has been mixed replys, running Lazarus IDE under wayland works for some not others.

I am in-between, some times it works fine, other times it responds so slow its almost unusable ( 5 secs to respond to a mouse click ). btop shows high CPU use for lazarus while waiting for a response to the mouse selection in the form editor.

Funny thing is if I am away from my work desk it runs fine, when I am at work desk then its bad.

I use a notebook i7 Gen 12 (thunderbolt 4 support). The only thing I have noticed is that its bad when plugged into the Dell Thunderbolt 4 dock. When at work its an older HP Thunderbolt 3 dock and its perfectly fine.

Does this make any kind of sense to anyone? The graphics card is still the intel Iris Xe just has an external monitor connected through a different dock.
It seems impossible but that is my observations to date.

paweld

  • Hero Member
  • *****
  • Posts: 1607
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #1 on: March 24, 2026, 09:07:14 am »
I can't help you because I mainly work on MS Windows, and when I do have to use Linux, it's XFCE on X11.

But if you want help, let know which versions of Lazarus and FPC you’re using, and ideally check out the Lazarus trunk/main, to which @zeljko regularly adds fixes: https://gitlab.com/freepascal.org/lazarus/lazarus/-/commits/main?ref_type=heads&search=qt6
Information about the operating system you're using might also be helpful.
Best regards / Pozdrawiam
paweld

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #2 on: March 24, 2026, 10:17:31 am »
Yes good point,
Lazarus 4.4 fpc 3.2.2
x86_64-linux-qt6
qt 6.10.2 kernel 6.18.13
It is only an observation, would be good to figure out what configurations work and which do not.
Hopefully it may help in some way?
I will check again tomorrow when at work with the old HP TB3 dock to see if its ok as today at my desk with the TB4 dock it was shocking.

Thaddy

  • Hero Member
  • *****
  • Posts: 19121
  • Glad to be alive.
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #3 on: March 24, 2026, 11:19:16 am »
I have:
X86_64-linux and aarch64-linux (Also
Debian trixie (which is wayland by default, not xwayland)
FPC trunk
Laz/trunk
Recent Qt6.

I find it quite essential for lazarus to work on wayland properly that you use the docked (modern) interface, not the floating classic interface. That is because wayland  (until recently, not rolled out in live distro's) does not know about windows positioning.
So : install docked if you are on wayland.
objects are fine constructs. You can even initialize them with constructors.

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #4 on: March 24, 2026, 11:34:34 pm »
At work today plugged into the old HP TB3 dock and all is fine. So whats up with the TB4 dock, its only lazarus I have an issue with?
Any suggestions would be appreciated on how I can diagnose this. journalctl shows nothing different between the two.

Thaddy

  • Hero Member
  • *****
  • Posts: 19121
  • Glad to be alive.
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #5 on: March 25, 2026, 09:58:12 am »
There are no obvious Lazarus traits or properties that can cause incompatibilities with a (any) docking station.
I suggest you look elsewhere first and at least recompile.
objects are fine constructs. You can even initialize them with constructors.

dbannon

  • Hero Member
  • *****
  • Posts: 3797
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #6 on: March 25, 2026, 12:15:34 pm »
While I agree with Thaddy in principle, I must comment that Thunderbolt 4 is pretty new in the Linux world. Thunderbolt uses DNA with little or not involvement from the CPU. So, its very hardware dependent.

So, if you have, say, some storage device at the far end of that Thunderbolt connection and connecting triggers, say, a backup, your DMA channel might be saturated and that would slow the system down. But that would imply a less than perfect thunderbolt implementation in you machine. But maybe ?

So, before giving up on the hardware angle, maybe disconnect other connected devices ?

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

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #7 on: March 25, 2026, 11:15:32 pm »
Thanks for the reply's. It is a very frustrating issue and I was wondering  if others who are finding lazarus on wayland less than satisfactory if hardware is a factor here. Its clear that lazarus works fine as I can use it at two sites which have older docks without issue, but  not at home with the TB4 dock. I was wondering if it could be something on the Qt6 rendering side of things. But even that is hard to believe when my complied QT6 app works fine as does plasma and its apps.
One question I find this in journalctl what does it mean, a web search does not provide any results

startlazarus[2724]: WARNING: TResourceCacheItem.IncreaseRefCount 1000 TFontHandleCache

PascalDragon

  • Hero Member
  • *****
  • Posts: 6387
  • Compiler Developer
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #8 on: March 26, 2026, 11:12:14 pm »
While I agree with Thaddy in principle, I must comment that Thunderbolt 4 is pretty new in the Linux world. Thunderbolt uses DNA with little or not involvement from the CPU. So, its very hardware dependent.

So, if you have, say, some storage device at the far end of that Thunderbolt connection and connecting triggers, say, a backup, your DMA channel might be saturated and that would slow the system down. But that would imply a less than perfect thunderbolt implementation in you machine. But maybe ?

Systems with Thunderbolt controllers (especially built-in ones like a laptop) have enough bandwidth on their PCIe host routers that DMA to connected devices (either directly or through a Thunderbolt tunnel) are no problems. And even if the bandwith for a PCIe tunnel should be shared with a DisplayPort tunnel on the Thunderbolt fabric there shouldn't be that much activity on the PCIe tunnel that there is that much latency.

Funny thing is if I am away from my work desk it runs fine, when I am at work desk then its bad.

I use a notebook i7 Gen 12 (thunderbolt 4 support). The only thing I have noticed is that its bad when plugged into the Dell Thunderbolt 4 dock. When at work its an older HP Thunderbolt 3 dock and its perfectly fine.

What is connected to the TB4 and TB3 dock? Does it also occur if you use your TB4 dock at work? Does it also occur if you swap the cables between the docks? (yes, that can make a difference as experience tought me... 😣) Does it occur if you daisy chain the docks (either Laptop -> TB3 -> TB4 or Laptop -> TB4 -> TB3)?

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #9 on: March 27, 2026, 02:16:07 am »
Each thunderbolt dock has

1 x 4k monitor (TB4 Dock monitor supports HDR)
1 x USB keyboard
1 x USB mouse
+ TB devices ( audio, ethernet etc)

i did try turning off HDR just in case but no difference. One thing I did notice was BTOP shows very different CPU usage between the two docks.

The image is btop on the TB4 dock selecting a component in the form editor. On the TB3 dock it does not do this as all, and I hardly see a blip in CPU

Update -  I thought I had better do some testing results :-
Plug screen directly into laptop and use laptops keyboard and touchpad - normal operation
Keep screen plugged into laptop and plug TB4 dock (with KB, mouse etc) - extreme lag
Plug screen back into dock, unplug usb KB and mouse from dock, use laptops keyboard/mouse - normal operation
Replug usb keyboard use laptop touchpad - normal operation
replug usb mouse - extreme lag
Leave all devices in TB4 dock but use touchpad of laptop - normal operation
Mouse clicks from the USB mouse are the issue, that really blew me away and I feel silly for not doing this before - unable to explain the why, I don't see any issue anywhere else??
« Last Edit: March 27, 2026, 07:35:48 am by TheMouseAUS »

PascalDragon

  • Hero Member
  • *****
  • Posts: 6387
  • Compiler Developer
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #10 on: March 28, 2026, 06:57:00 pm »
Update -  I thought I had better do some testing results :-
Plug screen directly into laptop and use laptops keyboard and touchpad - normal operation
Keep screen plugged into laptop and plug TB4 dock (with KB, mouse etc) - extreme lag
Plug screen back into dock, unplug usb KB and mouse from dock, use laptops keyboard/mouse - normal operation
Replug usb keyboard use laptop touchpad - normal operation
replug usb mouse - extreme lag
Leave all devices in TB4 dock but use touchpad of laptop - normal operation
Mouse clicks from the USB mouse are the issue, that really blew me away and I feel silly for not doing this before - unable to explain the why, I don't see any issue anywhere else??

Very interesting find 😲
I'd like to know a few more details how things are connected (e.g. there could either be a USB controller inside the dock or there will be USB tunnels to the TB related USB controller in the host), so for this I'd ask you to download the Free Edition of HDClone (the software of the company I work at), install that to a USB stick (if you're on Linux best download the ISO and dd it to a USB stick (please backup any data you might need)) and then boot from that USB stick (please note that only the main monitor of the laptop will work). Once the system is started (and maybe you've confirmed that the connected keyboard and/or mouse is indeed working (is it lagging there as well?)) go to the wrench icon at the bottom right and press "System Analysis". In the following popup press "Start". If network is available this will automatically upload the generated analysis package (please make a note of the returned tag (#12345) for me here) or it will ask for a device to store the package on (the boot device will be selected by default). In the later case please attach it here (or if you don't want this publicly available, you can send me a personal message with them attached). Do this for both Thunderbolt docks.
Maybe I can find out something through this...

TheMouseAUS

  • Full Member
  • ***
  • Posts: 107
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #11 on: March 29, 2026, 01:55:42 pm »
I brought a cheap mouse, plugged it into the TB4 dock, all worked fine.
I plugged the mouse that has issues directly into my laptop, leaving everything else on the dick and it had the same lag with high CPU. I did some digging and some mice cause the kernel to 'overload' with messages due to it being higher dpi, but normally this exposes itself system wide not just on one application. I will take a look at your suggestion and see what information it provides.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6387
  • Compiler Developer
Re: Lazarus in wayland QT6 Plasma 6.6.3
« Reply #12 on: March 30, 2026, 08:50:14 pm »
If it's really the mouse itself then my suggestion probably wouldn't provide much... especially considering that HDClone does not handle/use high DPI functionality...

 

TinyPortal © 2005-2018