Recent

Author Topic: [Solved]Open Project fails miserably in Lazarus 3.0, QT5...KIO  (Read 5261 times)

cdbc

  • Hero Member
  • *****
  • Posts: 1496
    • http://www.cdbc.dk
[Solved]Open Project fails miserably in Lazarus 3.0, QT5...KIO
« on: January 30, 2024, 12:12:27 pm »
Hi
Yesterday I installed laz 3.0 together with fpc 3.3.1 on my PCLinuxOS lappy.
I've compiled lazarus for Qt 5.15.6, went OK apart from 'Openfile-dialog' problems (speed and cpu-spike).
Today I'd like to open another existing project, so I click 'Project' -> 'Open Project' and ...The Sh** hit the fan! See attached error messages about KIO...
It's the same if/when I try to add a directory to the search-path.
That is QUITE annoying, as 3.0 seems to forget my search-paths from 2.2.6, blanks them out of the lpi  >:D
What gives?!? Anybody else with troubles like these?
Any help will be deeply appreciated
EDIT: @zeljko found the problem and the solution:
I've found where is problem !
IDE options -> Window

Uncheck all checkboxes which caption starts with "IDE title...".
Now save, try to open Open or Save dialog from IDE under KDE.
It is something about changing x11 window title (but that's what Qt does, not LCL)   >:(
There's even bug somewhere which was opened by Alexey Torgashin about changing window titles under x11.
and in the next post also from @zeljko:
Quote
Actually unchecking "IDE title shows project directory" fixes problem. That have something to do with KDE and it's file dialogs which uses title of app to check if it contains valid filename or path  :(
Thank you.
Regards Benny
« Last Edit: February 02, 2024, 08:01:09 am by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

zeljko

  • Hero Member
  • *****
  • Posts: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #1 on: January 30, 2024, 12:56:08 pm »
Sometimes I have KIO errors too. Some projects allow open files or save files, some return KIO error, only when run those dialogs under IDE, never at application runtime. That's pretty strange, and I've never found reason why it is so.

zeljko

  • Hero Member
  • *****
  • Posts: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #2 on: January 30, 2024, 12:57:57 pm »
Also, that problem arises only under KDE and with KDE dialogs (KIO), if you run lazarus under gnome or cinnamon that problem vanishes.

cdbc

  • Hero Member
  • *****
  • Posts: 1496
    • http://www.cdbc.dk
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #3 on: January 30, 2024, 02:58:02 pm »
Hi
@zeljko: what do you do, when it happens?
For now I have to manually edit the lpi file, then it works again...
It also seems, that laz /forgets/ to write the section in question, in the lpi file, leaving it blank, when it happens. That means 2.2.6 also sees blank entry for unit search-path, afterwards?!?
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

zeljko

  • Hero Member
  • *****
  • Posts: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #4 on: January 30, 2024, 05:56:26 pm »
I do exactly nothing, open an project which works (if I'm lucky it's in opened projects history submenu).
What do you exactly edit in lpi to get it work ?

cdbc

  • Hero Member
  • *****
  • Posts: 1496
    • http://www.cdbc.dk
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #5 on: January 30, 2024, 06:33:45 pm »
Hi
At the moment, the "battle" is about this section:
Code: XML  [Select][+][-]
  1.           <SearchPaths>
  2.             <IncludeFiles Value="$(ProjOutDir);../../bc_rtl/inc;inc;../../bc_svc/inc"/>
  3.             <OtherUnitFiles Value="../../bc_rtl;../../bc_svc;../../bc_svcmgr;../../bc_fcl;common;bom;../ledger_wizard/libldgwizard;../../bc_pluginmgr"/>
  4.             <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
  5.           </SearchPaths>
more specifically: "<OtherUnitFiles... etc./> it's simply not there.
That makes it problematic to fill it in anew, when the open-dialog is screwed  :'(
It's installed with fpcupdeluxe and as such contained in a directory: '/home/bc/laz_3/', the old install is tugged away in '/usr/lib64/...' and I'm under the impression, that the 2 installs don't interact.
   ?!?  %)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dbannon

  • Hero Member
  • *****
  • Posts: 2993
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #6 on: January 31, 2024, 12:07:06 am »
Benny, while not a KDE user, I do test my own app on KDE platforms and have not had a problem.

As I understand it, KIO is about file I/O over a network connection ?  So, Samba, NFS, sshfs type of things ?  Are you really trying to run Lazarus with its files connected over a network ??

Anyway, maybe some suggestions that you probably have already thought of -
  • Have you tried building a GTK2 version of Lazarus (to check its really a Qt5 problem) ?
  • Have you tried switching your KDE Desktop to use X11 rather that Wayland (yes, does not seem to be a typical wayland problem but given that KDE has only recently switched to Wayland, possible. And I am very suspicious of Wayland, its not ready yet.)
  • Have you tried other KDE distros (in eg Virtual Box) ?  PCLinuxOS is a rolling distro and that means it takes in some pretty new stuff. Not everything is always ready for production use (take Wayland for example).


If I get some time later today I will try it on Debian Trixie, that will be equally new but different !

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

cdbc

  • Hero Member
  • *****
  • Posts: 1496
    • http://www.cdbc.dk
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #7 on: January 31, 2024, 01:32:42 am »
Hi
Thanks Davo.
...You've given me an idea, awakening if you will...
Ofc, The whole KIO is a subsystem lurking in the bowels of KDE; And @zeljko told me, that with 3.0 the dialogs changed to using native dialogs instead of laz' own... Naturally the native dialogs hook into the KIO subsystem, which again amongst others, can see network shares etc... And I've got a nfs-server, that's offline most of the time, in my network... So if KIO is pulling that in, when I open a dialog, no wonder... then it can wait for a loooong time  %)
I think I need to talk to 'TexStar', mr. Reynolds is the father of PCLinuxOS... or some of his disciples, they're all in the know...
Me thinks, me got som' work to do... Be right'ish back with my findings...
Thanks again Davo
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

dbannon

  • Hero Member
  • *****
  • Posts: 2993
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #8 on: January 31, 2024, 02:37:09 am »
Sounds like your ideas there are worth following up. But my news from Debian Trixie KDE is not good. Not good at all.

Firstly, I can confirm you KIO issue under Qt5. But, and this is a one shot test, its crazy so needs confirming, the first time Lazarus is used after a restart, its OK.

But I also find an AV in the GTK2 version, at exactly the same spot (opening project) and again, I suspect, only after a previous start of Lazarus.

My own app seems quite happy to use the FileOpen dialog, built of course with Debian versions of FPC and Lazarus 3.0.

So, right now, I am not convinced of anything, its all guess work, will need to some restarts and repeated tests to get anything clear. I might get something done today but probably not, I am away from home tomorrow for 5 days ....

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: 2993
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #9 on: January 31, 2024, 03:48:57 am »
OK, this is really annoying.

I have restarted it several times, rebuilt both the gtk2 and Qt5 versions, blown away the Laz config, nothing I can do will bring back the two major problems I saw after the first respective builds (qt5 KIO error, gtk2 AV).  There is NO SIGN of those problems any more.

I do note two very annoying problems that definitly relate to Wayland, the mouse cursor is usually the wrong icon for the current task, annoying and sometimes hard to use. And when I start Lazarus, all the windows are in the wrong place, just centered in the screen, maybe relating to the know problem of Wayland not reporting its coordinates properly. In both these cases, switching to X11 solves them. And it feels a bit faster too.

Time permitting, I will go back to a clean install to make sure the 'fix' I see is not due to a gtk2 dependency. But pretty sure its not (but an easy test because of Virtual Box).

Here are some screen dumps, from using a FileOpen Dialog, neither can be repeated. Firstly when running Qt5 -
Code: [Select]
.qpa.wayland: Wayland does not support QWindow::requestActivate()
QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType text/plain;charset=utf-8
//---------  repeated about 15 time, Davo
QWaylandDataOffer: error reading data for mimeType text/plain;charset=utf-8
QWaylandDataOffer: timeout reading from pipe
QWaylandDataOffer: error reading data for mimeType text/plain
kf.kio.filewidgets.kfilefiltercombo: Could not find filter "*.lpi|Lazarus project(*.lpi) "
kf.kio.widgets: Cannot read information about filesystem under path "/home/dbannon/.cache/thumbnails/"
VMware: No 3D enabled (0, Success).
libEGL warning: egl: failed to create dri2 screen
kf.kio.widgets: Cannot read information about filesystem under path "/home/dbannon/.cache/thumbnails/"
kf.kio.widgets: Cannot read informati

Code: [Select]
int: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/dbannon/bin/Lazarus/LazConfigs/lazarus_3_0"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"
Looking for code tools config file:  "/home/dbannon/bin/Lazarus/LazConfigs/lazarus_3_0/codetoolsoptions.xml"
NOTE: codetools config file not found - using defaults
NOTE: help options config file not found - using defaults
TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $000000000065AEFA  GTK_CLASS_GET_TYPE,  line 132 of gtk2proc.inc
  $000000000065BA4E  GTKWIDGETISA,  line 376 of gtk2proc.inc
  $0000000000512241  ISWINDOW,  line 6571 of gtk2winapi.inc
  $000000000056D841  ISWINDOW,  line 646 of include/winapi.inc
  $000000000048A90E  SHOWMODAL,  line 3074 of include/customform.inc
  $0000000000DC5B0A  SHOWPROJECTWIZARDDLG,  line 108 of projectwizarddlg.pas
  $00000000004C3734  DONOPROJECTWIZARD,  line 6444 of main.pp
  $00000000004B0464  SETUPSTARTPROJECT,  line 2452 of main.pp
  $00000000004ACDEF  STARTIDE,  line 1696 of main.pp
  $00000000004217CB  main,  line 150 of lazarus.pp
FreeFormEditor: FormEditor1=TFormEditor
Hint: (lazarus) [TMainIDE.Destroy] B  -> inherited Destroy... TMainIDE
Hint: (lazarus) [TMainIDE.Destroy] END






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: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #10 on: January 31, 2024, 08:55:45 am »
I'll take some time over Qt5 dialogs and KIO problem. Biggest problem with it is that KIO error raises only when using open/save dialogs in lazarus, never in any application. Can anybody create example project where KIO produces error, so in that case it will be easier to fix ?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4508
  • I like bugs.
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #11 on: January 31, 2024, 08:59:05 am »
I also get a KIO worker error with Lazarus IDE built for LCL-QT5. It prevents me opening projects. I use an IDE built for LCL-GTK2 when I want to open a project.
This happens under Manjaro Linux + KDE.
It started to happen some months ago. I don't remember exactly when, I was busy with other stuff.
Strangely I remember seeing the same problem already years ago with LCL-QT4, but then it went away.
I don't have any network shares. Just a simple PC.
It could be triggered by changes in LCL-QT5 or by Manjaro's updated QT5 lib or KDE.
I will study later how an OpenDialog behaves in a user application and with QT4.
@cdbc, I don't understand how <OtherUnitFiles... etc./> setting in a project info file (*.lpi) could affect KDE's KIO system. Do you mean you cannot change it because of the KIO problem?
« Last Edit: January 31, 2024, 09:02:09 am by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

zeljko

  • Hero Member
  • *****
  • Posts: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #12 on: January 31, 2024, 09:56:55 am »
Juha, Qt5 uses native dialogs by default (so under KDE it's KDE dialog, under Gnome it's gtk(2,3) dialog, under windows native Windows dialog). Qt4 uses Qt dialogs, so there's no kio errors.
There is something wrong when dialog is started from IDE (lazarus fills history and filters for dialog). Apps works normall. Also , some projects don't raise KIO error - work without problem.

dbannon

  • Hero Member
  • *****
  • Posts: 2993
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #13 on: January 31, 2024, 12:18:22 pm »
I use an IDE built for LCL-GTK2 when I want to open a project. This happens under Manjaro Linux + KDE.
But I saw an AV when opening a project with a gtk2 build. Once. I am totally unable replicate it.
And the same applies to the Qt5 build, the open dialog behaves it self perfectly now. And I have tried and tried ....
Honestly, if Benny had not reported it, I don't think I would. Its too irreproducable. I really did see those two errors, honestly !

Juha, do you see the other two problems I see ?  Attached image is how it opens every time, Lazarus windows all centered. And the mouse cursor icons are all over the place. But both problems go away if I switch it to use X11 instead of Wayland.

I just built a Debian 12 Bookworm KDE, Lazarus 3.0, Qt5. Its FileOpen Dialogs work perfectly. No sign of the silly mouse cursor problem but when opening Lazarus, it too wants to put all the lazarus windows in the center of the screen.

David
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: 1632
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Open Project fails miserably in Lazarus 3.0, QT5...
« Reply #14 on: January 31, 2024, 12:27:13 pm »
dbannon, windows postitions are about wayland implementation in qt5, that should be much better with Qt6 wayland.
KIO error raises only under KDE plasma, not under Gnome, Cinnamon etc.

 

TinyPortal © 2005-2018