Recent

Author Topic: Ubuntu 19.10 and libgdk  (Read 1850 times)

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Ubuntu 19.10 and libgdk
« on: October 20, 2019, 08:39:03 am »
I have just tested my app against the newly released Ubuntu 19.10, default install being Gnome of course.

Results seem a bit disappointing, there is, I suggest, a lot less GTK2 stuff in there compared to previous versions.  In particular, a basic Lazarus app fails at startup complaining of missing libgdk-x11.  Interestingly, I cannot find such a library in the appropriate repo. Assume its bundled in with something else.

I normally tell my end users to ALWAYS use dgebi to install a local or downloaded file as its good at resolving dependencies. (Apt and dpkg are not when the deb file is sitting on your local disk).  Fortunately, gdebi must be built using similar gtk2 dependencies as our Lazarus apps and installing it first results in all the necessary libraries being installed.

I note that some other non Gnome Distributions are indicating they will be leaving out GTK2 stuff as time goes by so its not just those (expletive deleted) Gnome devs at work here I am afraid. Sigh....

If your install model is not deb based, its something you may need to watch out for.

When I have some time, might build another VM and try and workout exactly what missing libraries a minimal Lazarus app is dependent on in this brave new world.

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3188
  • My goal: build my own game engine using Lazarus
Re: Ubuntu 19.10 and libgdk
« Reply #1 on: October 20, 2019, 11:51:52 am »
I've just upgraded my Ubuntu Mate to version 19.10. So far, everything seems to works correctly. But only 1 issue which if I remember correctly it already happened since version 18.10:

https://forum.lazarus.freepascal.org/index.php/topic,46771.msg336414.html

Do you experience similar issue when running program that has TOpenGLControl? It only happens if I run it from the Lazarus IDE.

Back to the topic. I checked my system and I found I do not have libgdk-x11 installed too. But I still can do debugging in Lazarus. Is libgdk-x11 really needed?

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #2 on: October 20, 2019, 12:47:11 pm »
Do you experience similar issue when running program that has TOpenGLControl? It only happens if I run it from the Lazarus IDE.

Back to the topic. I checked my system and I found I do not have libgdk-x11 installed too. But I still can do debugging in Lazarus. Is libgdk-x11 really needed?

I have not tried TOpenGLControl, not in my test suite.

I 'believe' libgdk-x11 is needed because my test app, very basic, failed complaining about that Library.  After I installed gdebi and all its depandancies my test app runs and I can see the library installed. But it was not listed as one going to be installed, must have come along with something else. I reckon your system is running OK because its an upgrade, not a new install. You will have those GTK libraries left over from previous install.

The mystery deepens ....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3188
  • My goal: build my own game engine using Lazarus
Re: Ubuntu 19.10 and libgdk
« Reply #3 on: October 20, 2019, 01:26:31 pm »
I use Synaptic Package Manager, it is a good tool for inspecting library issue. It did not show I have libgdk-x11 installed on my system. So that makes me think libgdk-x11 is not needed.

After I upgraded my Ubuntu, I experienced the Ubuntu-TrayIcon issue. My program didn't show on the tray icon. Recompiling the project solved the problem.

I hate OS upgrade. It often full of surprises.

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #4 on: October 20, 2019, 11:27:26 pm »
Yep, we are going to see a lot of TrayIcon issues. Up until 19.10, Ubuntu supported the old model.  With 19.10, you needed to use the LibAppIndicator3. Did you note that your TrayIcon only supports a menu now, no click handler executing your own code.

If you distribute your app to other Linux users, better read the wiki article.

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Handoko

  • Hero Member
  • *****
  • Posts: 3188
  • My goal: build my own game engine using Lazarus
Re: Ubuntu 19.10 and libgdk
« Reply #5 on: October 21, 2019, 03:45:31 am »
After the upgrade, the libappindicator3-1 is installed automatically. A TrayIcon program I wrote did not show up. I didn't modify the code but simple recompiled the project using Lazarus 2.0.4, seemed to fix the issue. I will report back if I found something weird.

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #6 on: October 21, 2019, 04:32:09 am »
Ah, so 2.0.4 had my first attempt to fix this, it uses libappindicator3 if its available. Even if its not the best choice for a given OS. The trouble with the LibAppIndicator3 approach is that it only works with a Menu, so apps that depend on the old system tray sending an an OnClick event won't work. 

Both Fixes and 2.0.6 are a little smarter and try to use the old approach is they can, only using the Libappindicator3 if its known the os wont work in the old approach. But I am afraid they will get it wrong in U19.10 because it came out after my patch was submitted. And its a bit close to 2.0.6 now to be making more changes.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

sash

  • Sr. Member
  • ****
  • Posts: 275
Re: Ubuntu 19.10 and libgdk
« Reply #7 on: October 27, 2019, 01:20:11 pm »
Ubuntu XFCE upgraded 19.04 -> 19.10.
No problems, either with menu or without it.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

lucamar

  • Hero Member
  • *****
  • Posts: 2081
Re: Ubuntu 19.10 and libgdk
« Reply #8 on: October 27, 2019, 03:59:09 pm »
In particular, a basic Lazarus app fails at startup complaining of missing libgdk-x11.  Interestingly, I cannot find such a library in the appropriate repo. Assume its bundled in with something else.

Yes, libgdk-x11 should be installed as part of the full libgtk2.x package. I've looked in Ubuntu 12.04 up to 16.04 and it's always there.

YMMV, though; I haven't got any machines with a more modern (or a different) distro.

HTH.

ETA: Sorry for being so late; I forgot to look about for this ... :-[
« Last Edit: October 27, 2019, 04:02:02 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #9 on: October 28, 2019, 06:12:19 am »
Ubuntu XFCE upgraded 19.04 -> 19.10.
No problems, either with menu or without it.

Yep, thats what I expect. Upgrades generally don't remove things even if they have been declared 'legacy'.  In the case of Xfce, a new install might be a problem soon because the the Xfce devs have announced a programme to remove GTK2 over the next few releases. See
https://www.phoronix.com/scan.php?page=news_item&px=Xfce4-Panel-No-More-GTK2

But the real problems are on Gnome distros, especially Redhat.

Lucamar -
Yep, I found that lingdk-x11 is a dependancy of libgtk2 so all we seem to need is to ensure our apps are marked as being dependant on GTK2 and all will be good.

But folks, better start poking around at GTK3, its already on most peoples machines (yes, even 16.04) but to compile there you probably need libgtk3-dev ....

Davo


 
« Last Edit: October 28, 2019, 06:14:34 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

sash

  • Sr. Member
  • ****
  • Posts: 275
Re: Ubuntu 19.10 and libgdk
« Reply #10 on: October 28, 2019, 10:22:16 am »
Well, just tried vanilla live USB stick Xubuntu 19.10 and can confirm an issue exists:
Application runs but no TrayIcon is visible. In some panel configurations (no packages installed) tray icon appears, but no hints or clicks are working.

Other than that - application runs ok, and ldd shows no missing lib dependencies.

P.S. By the way, after upgrade to 19.04 I suffered from a tray icon bug, that was either xfxce/gtk/compositor related (but not to Lazarus at all) which was actually fixed after upgrade to 19.10.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #11 on: October 28, 2019, 11:20:05 am »
Well, just tried vanilla live USB stick Xubuntu 19.10 and can confirm an issue exists:
Application runs but no TrayIcon is visible. In some panel configurations (no packages installed) tray icon appears, but no hints or clicks are working.
OK, important point here sash, which version of Lazarus are you using ?

If you have a current Fixes, please try running your system tray app with LAZUSEAPPIND=YES    you may need to install LibAppIndicator3 first.  Launch like this -
LAZUSEAPPIND=YES ./project1 <enter>

You will get some info on the terminal.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

sash

  • Sr. Member
  • ****
  • Posts: 275
Re: Ubuntu 19.10 and libgdk
« Reply #12 on: October 28, 2019, 01:08:08 pm »
OK, important point here sash, which version of Lazarus are you using ?

See my signature. Application was compiled there and tested with Live Xubuntu.
As I said all researches could be made with Live distro (no installation required at all - just reboot from cd/usb) or even on virtual machine.

At the moment I'm a little busy, let's just return to this in a couple of days.
Lazarus 2.0.6 FPC 3.0.4 x86_64-linux-gtk2 -- Ubuntu 19.10 XFCE

dbannon

  • Hero Member
  • *****
  • Posts: 755
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Ubuntu 19.10 and libgdk
« Reply #13 on: October 29, 2019, 09:54:45 am »
Yes sash, I do my testing on VirtualBox, I have six distributions, each with several desktops.

But I don't have Lazarus 202 ! You will need something newer to use that env var I mentioned. 

My  testing of Xfce on Ubuntu said it used the "Old TrayIcon" model, you should see an Icon and be able to capture click events. All without using LibAppIndicator3.  But if distributing an app to other users, I suggest you don't try to capture Click events, just use a popup menu, that can be made work on just about anywhere.

As I mentioned earlier, future Xfce will not ship with a lot of GTK2 libraries. Sigh....

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

Thaddy

  • Hero Member
  • *****
  • Posts: 9183
Re: Ubuntu 19.10 and libgdk
« Reply #14 on: October 29, 2019, 11:00:48 am »
@sash
Plz use a maintained version for two reasons:
- any fix may be already applied
- any fix will not be back-ported.

I, for one, am not able - or willing - to test anything else but a latest release version or trunk: those can receive patches.
« Last Edit: October 29, 2019, 11:03:49 am by Thaddy »
also related to equus asinus.