Recent

Author Topic: [SOLVED] Latest Lazarus Compiled program is Not Responsive  (Read 2526 times)

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 471
  • Programming is FUN only when it works :)
    • Cool Technology
[SOLVED] Latest Lazarus Compiled program is Not Responsive
« on: October 19, 2022, 05:51:55 pm »
Hello,

I am having an ISSUE with my latest Lazarus FreePascal Program I wrote.

I am using latest Ubuntu OS using WAYLAND interface and the LATEST LAZARUS COMPILER.

All this program does is read scheduled system shutdown date time and when only 10 minutes left before system shuts down it ALERTS the user of this impending system shutdown by popping up a form with displaying animated GIF or window and playing a warning AUDIO FILE in the background.

As soon as the program ALERTS while displaying GIF and playing AUDIO FILE, the program FREEZES momentarily putting up a message box saying, "Program is not responsive" with buttons force quit or wait. Then, the messagebox goes away until the next time ALERT or WARNING window is up and the Audio file is played. Ubuntu OS doesn't freeze or crash. It is only the Lazarus PROGRAM.

I read through this post and it seems that no one found a solution yet.

What do you think is happening?
« Last Edit: October 20, 2022, 05:40:13 am by Awesome Programmer »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Latest Lazarus Compiled program is Not Responsive
« Reply #1 on: October 19, 2022, 06:11:29 pm »
Hi!

Exchange Wayland with X11

Winni

mosquito

  • Full Member
  • ***
  • Posts: 144
Re: Latest Lazarus Compiled program is Not Responsive
« Reply #2 on: October 19, 2022, 07:05:46 pm »
I have solved several problems with the latest versions of Lazarus and the "Tiled Window Managers" launching my program like this:

/home/user/bin/mylazprogram -disableaccurateframe

I don't think this can help you, but to try ...

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Latest Lazarus Compiled program is Not Responsive
« Reply #3 on: October 19, 2022, 09:22:30 pm »
I am missing code that show "how" so my 50c be like, put your methods into a thread.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 471
  • Programming is FUN only when it works :)
    • Cool Technology
Re: Latest Lazarus Compiled program is Not Responsive
« Reply #4 on: October 20, 2022, 05:39:56 am »
Thank you all for the replies...

Well, as it turns out Winni is right. My issue went away after I disabled WAYLAND. I thought there was something wrong with my code. I rewrote my program more than 10 different ways every time refining it or making it simpler and every time I had this hang ups...

No more hang ups now...

 :) :) :) :) 8-) 8-) 8-) 8-) 8-)

Thank you...
« Last Edit: October 20, 2022, 05:43:02 am by Awesome Programmer »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5942
  • Compiler Developer
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #5 on: October 20, 2022, 07:12:17 am »
That won't be a solution forever cause sooner or later distributions will start to drop X11. And some users might not want to disable Wayland only because a single program makes problems. They'll drop the program instead.
The question thus is: is this an issue in your program, in the LCL in general, the widgetset itself (which one do you use?) or in Wayland itself?

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #6 on: October 20, 2022, 10:43:07 am »
Hi!

Wayland is a bunch of errors -since years.

Save your precious time and use X11. For the next years.

As Wayland is full of errors it wont replace X11 soon.

Winni

dbannon

  • Hero Member
  • *****
  • Posts: 3320
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #7 on: October 20, 2022, 11:52:29 am »
Yes, PD sure has it right, Wayland, love it or hate it, we will have to live with it. Personally, I think its a bit like systemd, a great solution to a problem that does not exist.

And, like systemd, there will be some minor players who stick with X but most will (or have already) move to Wayland. So, we have to find and fix problems, not work around them. Maybe not if you are making apps for your own use but anything you hope to distribute must work OK under Wayland.

Awesome has not told us exactly what Ubuntu he is using, probably U22.04 but U22.10 is in beta and could be described as 'current'. And Awesome won't tell us which desktop is in use or show us the code that triggers to problem. Sigh. Awesome, please do -
Code: Pascal  [Select][+][-]
  1. env | grep SESSION_DESKTOP [enter]
  2. cat /etc/issue [enter]

I just now tested my app (I am in pre-release mode) on U22.04 Gnome, most likely culprit, and I see no problems. I cannot get the beta U2210 to install on VirtualBox.  The formal release of U22.10 is due any day now, maybe we'll see it there ?

But ignoring the problem, hope it goes away ? I don't think so.

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

Fred vS

  • Hero Member
  • *****
  • Posts: 3535
    • StrumPract is the musicians best friend
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #8 on: October 20, 2022, 01:37:12 pm »
Hi!

Wayland is a bunch of errors -since years.

Save your precious time and use X11. For the next years.

As Wayland is full of errors it wont replace X11 soon.

Winni

There is also the project XWayland, from X11 team, that makes all the X11 apps run on a "pure" Wayland system.

And XWayland project is highly maintained, with lot of commit each days.
Wayland has just few commits each month (and tons of issues).

Yes, we know they said that Wayland is the future and X11 will die soon.
But it is already more than 20 years that I listen to that same song and Wayland is more buggy after each commit.

And X11/XWayland  is each day more strong.

Here some note about RPi+Wayland:
https://www.phoronix.com/news/Raspberry-Pi-OS-Wayland

Quote
    Before going any further, please note – we absolutely do not recommend most people run on top of Wayland yet! This is experimental code and there are many features which are not yet supported under Wayland. (To name a few – taking screenshots, the screen magnifier, any remote desktop application, the screen resolution setting tool; we hope to get some of these working in due course, but for now, they don’t.)

@Davo.
Did you try to compile your app with GTK3/Wayland (and have a "pure" Wayland binary) or is your app still a X11 application that uses XWayland to run on a "pure" Wayland system?

If yes, what is your verdict ( for example for the Firefox project, lot of  people recommand to use Firefox/X11 on Wayland+XWayland vs the "pure" Firefox/Wayland (because too much problems).

@Awesome.
Can you tell us if you are using Lazarus compiled with "pure" Wayland GTK3 or with X11 GTK 2(so using XWayland)?
Also for your application, is it a "pure" Wayland app or a X11 app using XWayland?

@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.
For example the Lazarus LCL-CustomDraw could have a Wayland target ( and other widgetset too  ;) ) .

@Everybody.
Imho, Wayland is maybe for the future but sure it is not for now ( and a long now ).

Fre;D
« Last Edit: October 20, 2022, 03:08:05 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

dbannon

  • Hero Member
  • *****
  • Posts: 3320
    • tomboy-ng, a rewrite of the classic Tomboy
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #9 on: October 21, 2022, 12:58:27 am »
There is also the project XWayland, from X11 team, that makes all the X11 apps run on a "pure" Wayland system.
Yes Fred, in practise, we, gtk2 users in particular are not really using Wayland directly, we use XWayland. Its a "compatibility layer" between our app that wants to talk X11 and the Display that wants to get its instructions from Wayland.

Quote
And X11/XWayland  is each day more strong.
Indeed. I "think" that much of the improvements we have seen with our apps and Wayland in the last two years are, in fact, XWayland improvements. But my knowledge is superficial.

Quote
@Davo.
Did you try to compile your app with GTK3/Wayland (and have a "pure" Wayland binary) or is your app still a X11 application that uses XWayland to run on a "pure" Wayland system?
No Fred, sadly, Lazarus GTK3 is still a long way away from being ready for production.

So, we compile good old standard GTK2 apps and, generally, they all work find. Most GTK distros install GTK2 "out of the box" but there has been the occasional hiccup.

Quote
@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.
For example the Lazarus LCL-CustomDraw could have a Wayland target ( and other widgetset too  ;) ) .
Wayland does not provide widgets, its a display server. I suspect (but have not looked) that Andrews solution must have chosen to assume either GTK3 or GTK4 ?  Sounds very interesting anyway.

Quote
@Everybody.
Imho, Wayland is maybe for the future but sure it is not for now ( and a long now ).

Well, they said that about systemd and look where we ended up. 

I recently tested a U2204 Gnome, gnome long being first adopters of Wayland. Now, my Wayland experiences have not been good previously, some years ago, Gnome decided to remove "distractions" like the System Tray and while there were a number of projects that restored it, they all stopped working when Wayland appeared. More recently, libayana seems to solve that problem and was "built in" in many distros and, could, with excessive effort be made work with Gnome. To my surprise, its all pre installed in U2204 Gnome and thats very important to me !

My point it, its getting better at quite a rapid rate. And will continue to get better. LCL, being dependent on GTK2 and XWayland does look a risk IMHO. There are heaps of other GTK2 apps around at present but slowly they are catching up, these compatibility layers will not be maintained or pre-installed forever and certainly not 'just' for Lazarus.

Truth is Wayland is more secure, X11 is a network protocol, lots and lots of hooks a hacker can attach to. And Wayland has the potential to be a lot faster because it provides a much shorter path between the app and the screen. Neither of those advantages appear in XWayland of course.

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

Fred vS

  • Hero Member
  • *****
  • Posts: 3535
    • StrumPract is the musicians best friend
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #10 on: October 21, 2022, 01:52:08 am »
Quote
@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.
For example the Lazarus LCL-CustomDraw could have a Wayland target ( and other widgetset too  ;) ) .
Wayland does not provide widgets, its a display server. I suspect (but have not looked) that Andrews solution must have chosen to assume either GTK3 or GTK4 ?  Sounds very interesting anyway.

Hum i was talking about the target Wayland for LCL customdraw who is, afaik, a independent widgetset (no GTK or qt dependent).
And for other widgetset I was thinking to msegui.  :-[

Andrew did the fpc-Pascal headers+code to use Wayland server, like the X11 fpc package does for X11 (and is used by lcl-customdraw/fpgui/msegui).

I agree with all your notes and yes, even if it will be a hard work, we need to jump asap into Wayland code to be ready when Wayland is the norm (it is already for Android.)

Fre;D

« Last Edit: October 21, 2022, 02:10:10 am 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

PascalDragon

  • Hero Member
  • *****
  • Posts: 5942
  • Compiler Developer
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #11 on: October 21, 2022, 04:01:16 pm »
@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.

We don't need to add everything and the kitchen sink to FPC. With Andrew's repository there already exists a solution.

For example the Lazarus LCL-CustomDraw could have a Wayland target ( and other widgetset too  ;) ) .

In that case it would be enough if the Wayland units are part of Lazarus.

Quote
@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.
For example the Lazarus LCL-CustomDraw could have a Wayland target ( and other widgetset too  ;) ) .
Wayland does not provide widgets, its a display server. I suspect (but have not looked) that Andrews solution must have chosen to assume either GTK3 or GTK4 ?  Sounds very interesting anyway.

These are the low level bindings to Wayland. No GUI toolkit involved at all.

Fred vS

  • Hero Member
  • *****
  • Posts: 3535
    • StrumPract is the musicians best friend
Re: [SOLVED] Latest Lazarus Compiled program is Not Responsive
« Reply #12 on: October 21, 2022, 04:35:09 pm »
@PascalDragon.
What about the to add in fpc a fpc-Wayland package ( like the one from Andrew https://github.com/andrewd207/fpc-wayland ) ?
So we all can explore Wayland with fpc and share the result.

We don't need to add everything and the kitchen sink to FPC. With Andrew's repository there already exists a solution.

OK.  ( it was an attempt to attract other explorers, and not be alone in this jungle.  :-X)
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

pik33

  • Jr. Member
  • **
  • Posts: 78
Re: Latest Lazarus Compiled program is Not Responsive
« Reply #13 on: October 29, 2024, 04:31:31 pm »
I have solved several problems with the latest versions of Lazarus and the "Tiled Window Managers" launching my program like this:

/home/user/bin/mylazprogram -disableaccurateframe

I don't think this can help you, but to try ...

This-disableaccurateframe, added to Lazarus shortcut, solved the problem with this stupid empty window that prevented Lazarus to start on Wayland RPi desktop.

 

TinyPortal © 2005-2018