Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-11-03 Thread Juha Manninen
Unfortunately I don't have much info about TrayIcons.
Is it possible to add this Unity support to LCL? The idea sounds good
but the discussion stopped early.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-11-03 Thread zeljko

On 11/03/2015 03:17 PM, Anthony Walter wrote:

My patch checks for Unity and KDE desktop. Just remove the KDE check and
it should be good to go. By the way I tested on Mint 13 Cinnamon (based
on 12.04) and it still works.

https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/lazarus/lcl/interfaces/gtk2/unitywsctrls.pas#L264


I'll try to implement it in lazarus during weekend.



To people with actual SVN commit rights, if this gets add it into the
LCL could you remember to add me to the Lazarus contributor lists? Thanks.


Sure.

zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-11-03 Thread Juha Manninen
On Tue, Nov 3, 2015 at 4:37 PM, zeljko  wrote:
> I'll try to implement it in lazarus during weekend.

I promise to test it under various Linux desktop systems.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-11-03 Thread Anthony Walter
My patch checks for Unity and KDE desktop. Just remove the KDE check and it
should be good to go. By the way I tested on Mint 13 Cinnamon (based on
12.04) and it still works.

https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/lazarus/lcl/interfaces/gtk2/unitywsctrls.pas#L264

To people with actual SVN commit rights, if this gets add it into the LCL
could you remember to add me to the Lazarus contributor lists? Thanks.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-11-03 Thread zeljko

On 11/03/2015 02:22 PM, Juha Manninen wrote:

Unfortunately I don't have much info about TrayIcons.
Is it possible to add this Unity support to LCL? The idea sounds good
but the discussion stopped early.


Yes it's possible, but wm recognition should be added...eg maybe you run 
kde instead of unity on ubuntu, but unity trayicon lib is installed, so 
it'll load unity trayicon instead of xorg one (afair from looking into 
sources of that patch).


zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-18 Thread Luca Olivetti

El 12/10/15 a les 17:53, Anthony Walter ha escrit:

In fact I checked your code and it only tries to load libappindicator if
XDG_CURRENT_DESKTOP is Unity. With that variable set I can see the tray
icon (note that its normal value is KDE).

That's good then. I added 'KDE' to the allowed desktops when
libappindicator is present with the Gtk2 toolkit. I also recompiled the
64bit example program with this change and overwrote it in the
repository. So now if the fix it should also work on KDE, given
XDG_CURRENT_DESKTOP returns 'KDE'.

Thank for the link as well. It would seem, reading the information in
the link you posted, that Gtk3 uses libappindicator3-1. If anyone
actively is working on adding to Gtk3 lcl interface you may want to
consider looking at and copying some of the code I committed to github.



FYI, just saw this:

http://blog.davidedmundson.co.uk/blog/xembed_back

(from https://lists.debian.org/debian-kde/2015/10/msg00047.html)

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Anthony Walter
I create a fix for Lazarus TTrayIcon on Unity. if anyone wants to test it
out or add it to the LCL please do so. The fix is located here:

https://github.com/sysrpl/Lazarus.UnityAppIndicators

To use this fix get the code above and:

Add 'unitywsctrls.pas' to 'lazarus/lcl/interfaces/gtk2'
Apply patch to your 'lazarus' folder
Rebuild the 'lcl' package with the gtk2 widget set

A linux x86_64 compiled executable example is included.

A few notes:

It seems to me (which I say a lot because I'm not 100% positive) that app
indicators in Unity were designed to restrict programmers and guide the UI
design of Ubuntu in a specific direction. Namely to create more uniform
visual styles and user interaction with apps.

As such I believe the following restrictions to apply to Unity app
indicators:

  * You cannot receive click or any mouse events for icons in the tray.
  * A menu is required for an app indicator and the only action allowed is
to show the menu when the mouse clicks with either button on a tray icon.
  * An app can only have one app indicator and attempts to destroy or
create a new one fail.
  * You can only set the menu for an app indicator one time.
  * Icons can be set from files only (you are supposed to use
/usr/icons/share with themes).

More notes are in the source code.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Juha Manninen
A stupid question: what is the best Ubuntu version to test with?
I have avoided Unity desktop so far exactly because of the Lazarus
related problems.

Another question: what about Lazarus built with QT bindings but
running on Unity?

Third question: would it be possible to unite the TrayIcon code for
Unity and other desktops? Now you have 2 separate implementations.

Regards,
Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Luca Olivetti

El 12/10/15 a les 09:34, Anthony Walter ha escrit:


A linux x86_64 compiled executable example is included.



FWIW, that executable doesn't show any tray icon in kubuntu 15.04 with 
plasma 5.3.2.
As I reported before, trayicons in this environment don't work either 
with unpatched lazarus with the gtk2 widgetset but do work with the qt one.
Disclaimer: I don't usually need tryicons, but the various threads on 
them piqued my curiosity.


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread zeljko

On 10/12/2015 10:52 AM, Juha Manninen wrote:

A stupid question: what is the best Ubuntu version to test with?
I have avoided Unity desktop so far exactly because of the Lazarus
related problems.

Another question: what about Lazarus built with QT bindings but
running on Unity?


Don't know, but Qt handles such stuff and QTrayIcon is transparent to LCL.



Third question: would it be possible to unite the TrayIcon code for
Unity and other desktops? Now you have 2 separate implementations.


Maybe, but only in case if it's easy to extract information if we are 
under unity wm or other wm (I guess that it should not be an issue).


zeljko


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Michael Van Canneyt



On Mon, 12 Oct 2015, Juha Manninen wrote:


A stupid question: what is the best Ubuntu version to test with?
I have avoided Unity desktop so far exactly because of the Lazarus
related problems.

Another question: what about Lazarus built with QT bindings but
running on Unity?

Third question: would it be possible to unite the TrayIcon code for
Unity and other desktops? Now you have 2 separate implementations.


Ow, that is rather bad :(

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Anthony Walter
In fact I checked your code and it only tries to load libappindicator if
XDG_CURRENT_DESKTOP is Unity. With that variable set I can see the tray
icon (note that its normal value is KDE).

That's good then. I added 'KDE' to the allowed desktops when
libappindicator is present with the Gtk2 toolkit. I also recompiled the
64bit example program with this change and overwrote it in the repository.
So now if the fix it should also work on KDE, given XDG_CURRENT_DESKTOP
returns 'KDE'.

Thank for the link as well. It would seem, reading the information in the
link you posted, that Gtk3 uses libappindicator3-1. If anyone actively is
working on adding to Gtk3 lcl interface you may want to consider looking at
and copying some of the code I committed to github.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread zeljko

On 10/12/2015 02:42 PM, Anthony Walter wrote:

""Maybe, but only in case if it's easy to extract information if we are
under unity wm or other wm (I guess that it should not be an issue)."

{ UnityAppIndicatorInit returns true if Unity is the current desktop and
   the required appindicator libraries can be loaded }

function UnityAppIndicatorInit: Boolean;

The relevant HOWTO:

https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/lazarus/lcl/interfaces/gtk2/unitywsctrls.pas#L263-L267
https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/changes.patch#L18


ok, thanks. Can you provide result of TGtk2WidgetSet.GetWindowManager 
when you running simple app under unity ?


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Anthony Walter
The exe is 64 bit and built with the Gtk2 widget set. So the thing to test
would be if the Qt/KDE desktop normally shows with Lazarus applications
built the Gtk2 tray icon.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Anthony Walter
""Maybe, but only in case if it's easy to extract information if we are
under unity wm or other wm (I guess that it should not be an issue)."

{ UnityAppIndicatorInit returns true if Unity is the current desktop and
  the required appindicator libraries can be loaded }

function UnityAppIndicatorInit: Boolean;

The relevant HOWTO:

https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/lazarus/lcl/interfaces/gtk2/unitywsctrls.pas#L263-L267
https://github.com/sysrpl/Lazarus.UnityAppIndicators/blob/master/changes.patch#L18
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Patch for TTrayIcon on Ubuntu's Unity

2015-10-12 Thread Luca Olivetti

El 12/10/15 a les 14:37, Anthony Walter ha escrit:

The exe is 64 bit and built with the Gtk2 widget set. So the thing to
test would be if the Qt/KDE desktop normally shows with Lazarus
applications built the Gtk2 tray icon.


No, as I said, it doesn't.
But, as per

http://blog.martin-graesslin.com/blog/2014/06/where-are-my-systray-icons/

if the gtk2 application uses libappindicator for unity compatibility, it 
should also work with plasma.
In fact I checked your code and it only tries to load libappindicator if 
XDG_CURRENT_DESKTOP is Unity. With that variable set I can see the tray 
icon (note that its normal value is KDE).



Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus