Recent

Author Topic: Problem with TrayIcon: mantis 35723  (Read 1499 times)

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3628
  • I like bugs.
Re: Problem with TrayIcon: mantis 35723
« Reply #30 on: October 10, 2019, 02:28:11 pm »
Ahh sorry, missed one.
We have to add 'Debian' to the list of distros whose Gnome requires us to load the libappindicator3.
So, the list is now 'mageia', 'Red Hat', 'SUSE', 'Debian'
I added it in r62020. Will be merged.
I also optimized the code. /proc/version needs to be read only for Gnome.
BTW, has anybody tested how the TrayIcon works with GTK3 bindings? Our changes affect only GTK2 bindings.

Quote
So, I was looking at the 'wrong' trunk !  I will bookmark the right one and sure won't make that mistake again !
No, you looked at the right trunk but your web browser had cached the file and showed an old version. Pressing F5 helps as I wrote.
Please use proper tools for viewing the revision history.

Quote
I do struggle with svn, reasonably confident with git, use it for my own project, have used it professionally in the past. But I figure that svn is what FPC/Lazarus uses so I should make the effort.
You can use Git if you prefer it, either through a Github mirror or through git-svn link. We take Git formatted patches, no problem.

Quote
But Github sure does make looking at revisions easier! Happy at the command line...
No, Git makes looking at revisions easier. You confuse things. IMO Github is overrated. Doing a pull request there is no way easier than creating and uploading a patch.
« Last Edit: October 10, 2019, 02:56:48 pm by JuhaManninen »

dbannon

  • Hero Member
  • *****
  • Posts: 677
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with TrayIcon: mantis 35723
« Reply #31 on: October 11, 2019, 05:12:07 am »
I added it in r62020. Will be merged.
I also optimized the code. /proc/version needs to be read only for Gnome.
BTW, has anybody tested how the TrayIcon works with GTK3 bindings? Our changes affect only GTK2 bindings.
Excellent !

Its quite messy really, take Debian for example, lots and lots of Debian users are still on 9.9, that are a very conservative bunch. It works fine without LibAppIndicator3 but we've just patched LCL to only LibAppIndictor3 on (all) Debian Gnome because Debian 10.0 and 10.1 does require it. I would consider checking each version of every OS just too hard so we have to accept that existing Debian9.9 users will now need to manually install LibAppIndicator3 and TopIcons. Sucks !

Really need to make it a run time choice. But that would do nothing on other OS and is just a temp fix I am afraid. Long term we will either have to drop the TrayIcon or make it work in the new mode.

 I have never tried GTK3, all my effort to keep my app going under GTK2, Windows, QT and Carbon/Cocoa. I was under impression it is quite incomplete ? Might have a play....

EDIT: Seems there is no TrayIcon implementation in GTK3, RegisterCustomTrayIcon() just returns False.

Quote
No, you looked at the right trunk but your web browser had cached the file and showed an old version. Pressing F5 helps as I wrote.
I had been pressing F5, made no diff. I just manually emptied my Firefox cache and now do see you most recent modes. Thats pretty strange. I'll trust what I see on github in future.
« Last Edit: October 11, 2019, 11:11:13 am by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

dbannon

  • Hero Member
  • *****
  • Posts: 677
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Problem with TrayIcon: mantis 35723
« Reply #32 on: October 12, 2019, 06:26:46 am »
OK, sent my own app out to beta tester prior to its own next release (way overdue) based on code now in trunk->unityctrl.pas and first thing he comes back with is that he has lost his trayIcon !

Mageia Enlightenment but a beta version of that too. Hmm....

While we are still trying to establish why, thought I had better outline what I am doing with my app. It may well be against several Lazarus/FPC design rules and I am first to admit its as ugly as it gets but so is user apps failing when they update or change their distro.

In unityctrls.pas, I have code in the init function that looks for an environment variable called LAZUSEAPPIND, if its set to YES then we force an attempt to load Libappindicator3, if its NO we only rely on the old System TrayIcon and if its INFO we just log our decisions to stdout.

In this way, I can help an end user to identify what the problem is and, perhaps force one way or the other. Better than bringing out a new TrayIcon property that only Linux needs and, maybe only for a short while.

I'll make a patch and make it available ....

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