[Lazarus] Patch for TTrayIcon on Ubuntu's Unity

Anthony Walter sysrpl at gmail.com
Mon Oct 12 09:34:39 CEST 2015


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151012/e9af02bd/attachment-0002.html>


More information about the Lazarus mailing list