Recent

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

Sashulya

  • New member
  • *
  • Posts: 9
Problem with Lazarus in Ubuntu Gnome
« on: September 11, 2020, 11:37:54 pm »
Hi,
I have problem using Lazarus in Ubuntu 20.04 (with Gnome). I just installed the last version of Lazarus, 2.0.10, and converted my old Delphi project. The project is very light, but the resulting executable starts with a big delay, about 20-30 seconds. And before it starts it shows warning, like "Wait" or "Force Quit".
I found no reason why it could happen, and then I installed Lazarus in another Linux - Manjaro XFCE. Everything was fine there, no matter which executable I run - compiled in Ubuntu or in Manjaro, both start very quickly, as they should.
Then I tried even in Windows, opened and compiled this project in Lazarus - and everything was fine.
It seems like this problem with big delay exists only in Ubuntu (or probably in Gnome). Could you please tell me, is it a known problem, and what can be done with it?
« Last Edit: September 13, 2020, 11:35:44 am by Sashulya »

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu
« Reply #1 on: September 12, 2020, 01:31:46 am »
Surfing the internet, I found some partial solutions of this problem:

1. Compiled projects starts quickly with root privileges;

2. The problem disappears after installing appmenu-gtk2-module (sudo apt install appmenu-gtk2-module)

The second decision looks helpful, but of course I cannot distribute my application, if user's OS don't have this appmenu-gtk2-module installed. Maybe it is possible somehow to include this appmenu-gtk2-module in the project? If it is possible, could you please explain how it can be done?

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #2 on: September 12, 2020, 04:49:17 am »
Hello Sashulya,
Welcome to the forum.

I'm sorry to hear you have problem with Lazarus. I use Lazarus on Ubuntu Mate, so far no any serious issue.

Can you please provide any compile-able demo so we can inspect the problem? If you're not willing to publicize the project, you can write a simple demo that can show the problem.

Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Problem with Lazarus in Ubuntu
« Reply #3 on: September 12, 2020, 05:38:17 am »
Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

Better yet, use the "Lazarus > Project > Publish Project" option which will create a compressed archive of the project for you.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #4 on: September 12, 2020, 08:10:41 am »
Thank you for informing us the tool.

I tried it some years ago and I've just tested it again. No, it is not 'better' as you said. For example I tested it on my CATWW project, it did not include all the necessary images. It failed on my test.

Don't get me wrong. It would be great and I appreciate the attempt of creating the tool. Unfortunately it still need need more improvements to make it really usable.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Problem with Lazarus in Ubuntu
« Reply #5 on: September 12, 2020, 08:24:19 am »
For example I tested it on my CATWW project, it did not include all the necessary images. It failed on my test.

Did you add your image extension to the default list: *.(pas|pp|inc|lpr|lfm|lrs|lpi|lpk|xml|sh) ?

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #6 on: September 12, 2020, 08:37:33 am »
Yes, it works. Thank you.

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu
« Reply #7 on: September 12, 2020, 06:11:07 pm »
Hello Sashulya,
Welcome to the forum.

I'm sorry to hear you have problem with Lazarus. I use Lazarus on Ubuntu Mate, so far no any serious issue.

Can you please provide any compile-able demo so we can inspect the problem? If you're not willing to publicize the project, you can write a simple demo that can show the problem.

Create a new folder, copy and paste all the necessary files into it except: the binary (exe file), *.bak, lib and backup folders. Compress the folder and send the zip here.

Hi,

thanks for the info and tips, I decided to investigate further and installed Ubuntu MATE, which you use. And in MATE everything is fine!

So it seems that the problem can be narrowed down: the delay after start of compiled application exists in Ubuntu Gnome only.

I just checked, MATE has this package preinstalled: appmenu-gtk2-module
And it looks like it is the sourse of the problem - this package is not installed by default in Ubuntu Gnome, but without it a compiled application has a delay while starting.

I'll try to make some simple example soon, so it can be checked by other people, and then upload here.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Problem with Lazarus in Ubuntu
« Reply #8 on: September 12, 2020, 06:23:29 pm »
Thank you for reporting back and sharing what you found.
This will be useful for someone with similar problem as yours in the future.

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu
« Reply #9 on: September 13, 2020, 11:21:35 am »
Now I made a video to make the problem as clear as possible. As seen in video, the problem appears even with "dummy" project with single button:

https://www.youtube.com/watch?v=8NuJRA2wAFA

As we discussed, I also made a zip-archive of this project.

So, by now problem looks like this: Any project, made with the default installation of Lazarus, has a delay before starting, if the system has no appmenu-gtk2-module or some other gtk2-module installed. For example, in Ubuntu Gnome.

Seems like it depends on interface library, which by default is GTK2 in Lazarus.

Is it possible to solve this problem somehow by including some gtk2-module package in project, or do I need to use other libraries, like QT or GTK3? Thanks in advance.
« Last Edit: September 13, 2020, 10:12:59 pm by Sashulya »

Sashulya

  • New member
  • *
  • Posts: 9
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #10 on: September 21, 2020, 07:56:34 pm »
Could anybody help? :-[

No need to look into the archived code, it's almost empty project, but the video should explain the problem.

I hope I managed to explain the essence of the question :)

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #11 on: September 21, 2020, 08:08:33 pm »
Hello.

Are you using Ubuntu 20.04 with Wayland or Xorg display server?

Afaik, Lazarus is not yet Wayland compatible and needs to deal with a Xorg emulation.

Wayland offers a Xorg emulation but it needs some time for conversion and that could explain the delay.

Anyway, Andrew Haines has published his Wayland-fpc conversion, maybe Lazarus team could take a look at this:

https://github.com/andrewd207/fpc-wayland

Fre;D

« Last Edit: September 21, 2020, 08:11:44 pm by Fred vS »
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

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem with Lazarus in Ubuntu
« Reply #12 on: September 21, 2020, 09:24:35 pm »
2. The problem disappears after installing appmenu-gtk2-module (sudo apt install appmenu-gtk2-module)
The second decision looks helpful, but of course I cannot distribute my application, if user's OS don't have this appmenu-gtk2-module installed.
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?

Quote
Maybe it is possible somehow to include this appmenu-gtk2-module in the project? If it is possible, could you please explain how it can be done?
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.

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.
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 #13 on: September 21, 2020, 09:27:53 pm »
Hello.

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.

But thanks anyway!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Problem with Lazarus in Ubuntu Gnome
« Reply #14 on: September 21, 2020, 09:29:49 pm »
Afaik, Lazarus is not yet Wayland compatible and needs to deal with a Xorg emulation.
It is Wayland compatible when using a widgetset that supports Wayland directly. AFAIK QT5 supports it.
Anyway, Wayland has nothing to do with Sashulya's problem.

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.
« Last Edit: September 21, 2020, 09:31:49 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

 

TinyPortal © 2005-2018