Recent

Author Topic: Problem with Lazarus in Ubuntu Gnome  (Read 5345 times)

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu
« Reply #15 on: September 21, 2020, 09:35:56 pm »
You can instruct your clients to run the "apt install" command if they have a similar problem.
It requires root access but people who run graphical desktops on Linux typically have it.
Is there a reason why they could not do it?
I just wanted to make it free, i.e. anybody could download, install and use. Some additional instructions, even very simple, may seriousely reduce people's interest, I guess.

No, it is a system library.
Why LCL-GTK2 depends on it, nobody knows. I doubt it will be fixed ever, especially because GTK2 is becoming obsolete and all effort should go to improve LCL-GTK3.
Thanks for the info!
You should distribute also a LCL-QT5 version of your application. Then people can choose which one to use. LCL-QT5 is especially good with desktops built with QT5, like KDE. I personally have Manjaro + KDE and build my Lazarus mostly with LCL-QT5.
Thanks! Now I see that I should learn working with QT5. And as I understand, it will run fine even in GTK systems, so it seems to be good decision :)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem with Lazarus in Ubuntu
« Reply #16 on: September 21, 2020, 09:50:02 pm »
I just wanted to make it free, i.e. anybody could download, install and use. Some additional instructions, even very simple, may seriousely reduce people's interest, I guess.
Ubuntu users typically run "apt install" commands routinely. It should not be a problem.
You can also instruct them to use a proper Linux distro. Many people have an obsession with Ubuntu. In my opinion it is not a very good distro any more.

Quote
Thanks! Now I see that I should learn working with QT5. And as I understand, it will run fine even in GTK systems, so it seems to be good decision :)
Yes if the system has Qt5 libraries and the libQt5Pas C++ mapping lib.
At least Manjaro provides them all from its repository. Super-easy.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #17 on: September 21, 2020, 11:10:34 pm »
BTW, LCL does not have a direct X11 widgetset either. X11 is used indirectly through other GUI libraries like GTKx and QTx.

Ha, ok, I was thinking that LCL did have  direct access to X11.
So maybe Wayland is more a target for fpGUI or MSEgui.

For LCL I think that GTK3 has done lot of work to be Wayland compatible.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #18 on: September 22, 2020, 06:21:53 am »
>Are you using Ubuntu 20.04 with Wayland or Xorg display server?
Hi, just checked echo $XDG_SESSION_TYPE, it's X11, i.e. Xorg.
[/quote]

Sashulya, I think the key part of Fred's question was about which version of Ubuntu you are using.

There was an issue in U19.04 (hmm, was that U19.10?)  that could be solved by installing the module you mention, the problem related to Ubuntu leaving it out of the list of things that GTK2 depended on.  You should not be using U19.04 now, its out of date and no longer supported.

However, if you are seeing this same problem in a current version of Ubuntu, its bad, very bad !

Please tell us the version of Ubuntu you are using.  From the command line -
Code: [Select]
cat /etc/issue [enter]
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

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #19 on: September 22, 2020, 09:14:18 am »
Quote
Anyway, Andrew Haines has published his Wayland-fpc conversion, maybe Lazarus team could take a look at this:
You mean to create a new LCL-Wayland widgetset? Yes, good idea, but somebody must volunteer to do it. Who?
BTW, LCL does not have a direct X11 widgetset either. X11 is used indirectly through other GUI libraries like GTKx and QTx.

What about CustomDrawn-X11 then? At least according to the wiki it's supposed to be working in principle.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #20 on: September 22, 2020, 10:00:41 am »
I am not sure how this discussion about Wayland and our widgetsets will help the original question asker.  But ...

Both GTK2 and Qt5 seem to work fine under Wayland, Generally, I would not expect otherwise.  However, the System Tray Icon does not, and apparently will not because Wayland cannot pass back the position the user clicked (on the tray icon) back to the application.  There may, therefore be other widgets and widget like things that will not work with Wayland, possibly.

I have a number of users who use my app, tomboy-ng, with Wayland (on Fedora) and have to use an ugly workaround because of the lack of system tray icon. But otherwise, it works OK. Apparently.

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

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #21 on: September 22, 2020, 10:27:15 am »
What about CustomDrawn-X11 then? At least according to the wiki it's supposed to be working in principle.
Ok, I didn't remember that one. The CustomDrawn widgetset does not work very well. I was not able to run any application with it last time I checked.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #22 on: September 22, 2020, 01:27:45 pm »
There was an issue in U19.04 (hmm, was that U19.10?)  that could be solved by installing the module you mention, the problem related to Ubuntu leaving it out of the list of things that GTK2 depended on.  You should not be using U19.04 now, its out of date and no longer supported.

However, if you are seeing this same problem in a current version of Ubuntu, its bad, very bad !

Please tell us the version of Ubuntu you are using.  From the command line -
Code: [Select]
cat /etc/issue [enter]
Davo
Hi, it's Ubuntu 20.04.1 LTS. Quite a fresh installation, I use it about 2 months.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #23 on: September 23, 2020, 02:08:45 am »
Hi, it's Ubuntu 20.04.1 LTS. Quite a fresh installation, I use it about 2 months.

Oh, thats bad news indeed.  My test installs are U20.04, updated to U20.04.1, perhaps I had better get a real U20.04.1 installer and see if they have dropped the module out of that.  This could be very messy indeed.

Bad timing too, all the school kids are at home right now due to C19 lockdown and they are really putting some strain on the network bandwidth ;-)

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: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #24 on: September 23, 2020, 03:20:56 am »
Hmm, interesting results !
I made a new VM based on U20.04.1, nothing added or installed except sshfs (to transfer binaries in). It does not have the GTK2 appmenu module installed.

Now, it fails to run your app, but runs mine (some 16K lines) with out problems. I need to look through your very, very minimal app and see what you are doing !  Mine does use cmem because its multithreaded, must be other basic differences ...

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: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #25 on: September 23, 2020, 03:50:38 am »
OK, some answer, maybe not a good one !

I initially installed U20.04.1 and told it not to do updates as it installed (I have limited bandwidth). And like that, a pure U20.04.1 I see the problem you describe with a minimal Lazarus project. A form with a button on it.  But my app runs fine.

I tried a few easy checks of the diff between the minimal Laz app and mine, heaptrace, cmem, different debugging. No help.

So, I allowed the OS  to do its auto updates, it wanted to put some 250Meg on, must be a new kernel because it requested a reboot. And the problem went away !

Sashulya, have you allowed your OS to update itself since installing ?

I will have to repeat my tests to be sure but it seems that there is something dodgy in U20.04.1 and they have fixed it with some updates. Be a job to workout what that is and it might not be the updates at all but only further testing will reveal ...

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: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #26 on: September 23, 2020, 09:26:40 am »
No, sorry, on further testing, its not so simple. It seems its a random error, only when you do a bunch of tests do you see the pattern. So, I have run a minimal Lazarus app, a button on a form, 30 times. For comparison, I also run my app, a Lazarus GTK2 16K lines of code, also 30 times.

On U20.04.1 'out of the box' -
* Minimal Laz app - failed 20 out of 30 runs.
* tomboy-ng app  - did not fail in 30 runs.

On U20.04-1 with all updates available on 23 September -
* Minimal Laz app - failed 5 out of 30 runs.
* tomboy-ng app  - did not fail in 30 runs.

On U20.04-1 with all updates available on 23 September and appmenu-gtk2-module -
* Minimal Laz app - failed 14 out of 30 runs.
* tomboy-ng app  - did not fail in 30 runs.

So, this raises some very worrying questions -
* Thirty runs seems enough to draw a reasonable conclusion that something has improved between the release of U20.04.1 and now. But while its an improvement, it has not solved the problem completely.
* Appmenu-gtk2-module does not solve the problem, may indeed make it worse ?
* My much more complicated application does not seem to suffer from this issue.

tomboy-ng is a little unconventional in that its first unit is not an LCL unit, it has no GUI aspect, it examines the command line arguments and if certain ones are there, it does whatever is requested and exits, all without a GUI appearing.  In a more usual startup, that first unit starts the GUI units.

It also has a lot more things happening, obviously, but that startup seems a bit likely to be the difference ???

Anyone care to comment, please ?

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

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #27 on: September 23, 2020, 10:17:40 am »
Anyone care to comment, please ?
See my earlier comment about Ubuntu versus other distros.  :)
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #28 on: September 23, 2020, 01:40:08 pm »
Well, Juha, it certainly does seem that they are putting less and less effort into GTK2.
And the Gnome 3 desktop is certainly a problem on any distribution IMHO. 

I test my app at each release against a number of distributions and I have to say, I still think Ubuntu (Mate, not Gnome) feels the best. But maybe just because I'm so used to 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

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #29 on: September 24, 2020, 02:29:42 am »
Sashulya, have you allowed your OS to update itself since installing ?
Yes, I made installation with updates, and later allowed further updates, which also required reboot.

You've got interesting results, which are different from mine, because for my installation adding the appmenu-gtk2-module removed the problem completely. I made more than 100 trials already I guess, without single delay.

Well, it seems the problem not just exists, but can vary depending on certain installation.

Thanks for your investigation!
« Last Edit: September 24, 2020, 02:38:16 am by Sashulya »

 

TinyPortal © 2005-2018