View Issue Details

IDProjectCategoryView StatusLast Update
0029599LazarusPatchpublic2016-06-15 11:23
ReporterAnthony Walter Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntu 
Summary0029599: Patch for TTrayIcon on Unity
DescriptionThis is the patch to fix TTrayIcon Unity. It implements TTrayIcon using the Ubuntu app indicator app. On Gtk2 this patch checks if the app indicator lib is available create creating a TTrayIcon component. If the library is present and all functions load from it correctly new logic is used instead of the original Gtk2 TTrayIcon logic.

More information here:

https://github.com/sysrpl/Lazarus.UnityAppIndicators
Steps To ReproduceApply patch and copy unitywsctrls.pas to lcl/interfaces/gtk2/

TagsTTrayIcon, Ubuntu
Fixed in Revisionr51555, r51565, r51600
LazTarget-
WidgetsetGTK 2
Attached Files

Relationships

related to 0019304 acknowledged LCL Applications dont get own Icon in Unity Bar 
related to 0023712 resolvedJuha Manninen MenuItem Shortcut Captions missing in Ubuntu Unity global Menubar 
related to 0029638 closedJuha Manninen After 29599: Patch for TTrayIcon on Unity, TTrayIcon dont' works with Cinnamon 

Activities

Anthony Walter

2016-02-06 08:37

reporter  

unitytray.patch (47,522 bytes)   
Index: lcl/interfaces/gtk2/gtk2wsfactory.pas
===================================================================
--- lcl/interfaces/gtk2/gtk2wsfactory.pas	(revision 51507)
+++ lcl/interfaces/gtk2/gtk2wsfactory.pas	(working copy)
@@ -120,7 +120,8 @@
   Gtk2WSSpin,
   Gtk2WSStdCtrls,
   Gtk2WSPairSplitter,
-  Gtk2WSPrivate;
+  Gtk2WSPrivate,
+  UnityWSCtrls;
 
 // imglist
 function RegisterCustomImageList: Boolean; alias : 'WSRegisterCustomImageList';
@@ -460,7 +461,10 @@
 
 function RegisterCustomTrayIcon: Boolean; alias : 'WSRegisterCustomTrayIcon';
 begin
-  RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
+  if UnityAppIndicatorInit then
+    RegisterWSComponent(TCustomTrayIcon, TUnityWSCustomTrayIcon)
+  else
+    RegisterWSComponent(TCustomTrayIcon, TGtk2WSCustomTrayIcon);
   Result := True;
 end;
 
Index: lcl/interfaces/lcl.lpk
===================================================================
--- lcl/interfaces/lcl.lpk	(revision 51507)
+++ lcl/interfaces/lcl.lpk	(working copy)
@@ -128,7 +128,7 @@
     <License Value="modified LGPL-2
 "/>
     <Version Major="1" Minor="7"/>
-    <Files Count="438">
+    <Files Count="439">
       <Item1>
         <Filename Value="carbon/agl.pp"/>
         <AddToUsesPkgSection Value="False"/>
@@ -1115,1067 +1115,1071 @@
         <UnitName Value="Gtk2WSStdCtrls"/>
       </Item212>
       <Item213>
+        <Filename Value="gtk2/unitywsctrls.pas"/>
+        <UnitName Value="UnityWSCtrls"/>
+      </Item213>
+      <Item214>
         <Filename Value="gtk2/interfaces.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Interfaces"/>
-      </Item213>
-      <Item214>
-        <Filename Value="gtk2/issues.xml"/>
-        <Type Value="Issues"/>
       </Item214>
       <Item215>
-        <Filename Value="qt/issues.xml"/>
+        <Filename Value="gtk2/issues.xml"/>
         <Type Value="Issues"/>
       </Item215>
       <Item216>
+        <Filename Value="qt/issues.xml"/>
+        <Type Value="Issues"/>
+      </Item216>
+      <Item217>
         <Filename Value="win32/alllclintfunits.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="AllLCLIntfUnits"/>
-      </Item216>
-      <Item217>
+      </Item217>
+      <Item218>
         <Filename Value="win32/interfaces.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Interfaces"/>
-      </Item217>
-      <Item218>
+      </Item218>
+      <Item219>
         <Filename Value="win32/issues.xml"/>
         <Type Value="Issues"/>
-      </Item218>
-      <Item219>
+      </Item219>
+      <Item220>
         <Filename Value="win32/win32callback.inc"/>
         <Type Value="Include"/>
-      </Item219>
-      <Item220>
+      </Item220>
+      <Item221>
         <Filename Value="win32/win32debug.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32Debug"/>
-      </Item220>
-      <Item221>
+      </Item221>
+      <Item222>
         <Filename Value="win32/win32def.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32Def"/>
-      </Item221>
-      <Item222>
+      </Item222>
+      <Item223>
         <Filename Value="win32/win32defines.inc"/>
         <Type Value="Include"/>
-      </Item222>
-      <Item223>
+      </Item223>
+      <Item224>
         <Filename Value="win32/win32extra.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32Extra"/>
-      </Item223>
-      <Item224>
+      </Item224>
+      <Item225>
         <Filename Value="win32/win32int.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32Int"/>
-      </Item224>
-      <Item225>
-        <Filename Value="win32/win32lclintf.inc"/>
-        <Type Value="Include"/>
       </Item225>
       <Item226>
-        <Filename Value="win32/win32lclintfh.inc"/>
+        <Filename Value="win32/win32lclintf.inc"/>
         <Type Value="Include"/>
       </Item226>
       <Item227>
-        <Filename Value="win32/win32listsl.inc"/>
+        <Filename Value="win32/win32lclintfh.inc"/>
         <Type Value="Include"/>
       </Item227>
       <Item228>
-        <Filename Value="win32/win32listslh.inc"/>
+        <Filename Value="win32/win32listsl.inc"/>
         <Type Value="Include"/>
       </Item228>
       <Item229>
-        <Filename Value="win32/win32memostrings.inc"/>
+        <Filename Value="win32/win32listslh.inc"/>
         <Type Value="Include"/>
       </Item229>
       <Item230>
-        <Filename Value="win32/win32object.inc"/>
+        <Filename Value="win32/win32memostrings.inc"/>
         <Type Value="Include"/>
       </Item230>
       <Item231>
+        <Filename Value="win32/win32object.inc"/>
+        <Type Value="Include"/>
+      </Item231>
+      <Item232>
         <Filename Value="win32/win32proc.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="win32proc"/>
-      </Item231>
-      <Item232>
+      </Item232>
+      <Item233>
         <Filename Value="win32/win32themes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32Themes"/>
-      </Item232>
-      <Item233>
-        <Filename Value="win32/win32trayicon.inc"/>
-        <Type Value="Include"/>
       </Item233>
       <Item234>
-        <Filename Value="win32/win32winapi.inc"/>
+        <Filename Value="win32/win32trayicon.inc"/>
         <Type Value="Include"/>
       </Item234>
       <Item235>
-        <Filename Value="win32/win32winapih.inc"/>
+        <Filename Value="win32/win32winapi.inc"/>
         <Type Value="Include"/>
       </Item235>
       <Item236>
+        <Filename Value="win32/win32winapih.inc"/>
+        <Type Value="Include"/>
+      </Item236>
+      <Item237>
         <Filename Value="win32/win32wsbuttons.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSButtons"/>
-      </Item236>
-      <Item237>
+      </Item237>
+      <Item238>
         <Filename Value="win32/win32wscalendar.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSCalendar"/>
-      </Item237>
-      <Item238>
+      </Item238>
+      <Item239>
         <Filename Value="win32/win32wschecklst.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSCheckLst"/>
-      </Item238>
-      <Item239>
+      </Item239>
+      <Item240>
         <Filename Value="win32/win32wscomctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSComCtrls"/>
-      </Item239>
-      <Item240>
+      </Item240>
+      <Item241>
         <Filename Value="win32/win32wscontrols.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSControls"/>
-      </Item240>
-      <Item241>
+      </Item241>
+      <Item242>
         <Filename Value="win32/win32wscustomlistview.inc"/>
         <Type Value="Include"/>
-      </Item241>
-      <Item242>
+      </Item242>
+      <Item243>
         <Filename Value="win32/win32wsdialogs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSDialogs"/>
-      </Item242>
-      <Item243>
+      </Item243>
+      <Item244>
         <Filename Value="win32/win32wsextctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSExtCtrls"/>
-      </Item243>
-      <Item244>
+      </Item244>
+      <Item245>
         <Filename Value="win32/win32wsextdlgs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSExtDlgs"/>
-      </Item244>
-      <Item245>
+      </Item245>
+      <Item246>
         <Filename Value="win32/win32wsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSFactory"/>
-      </Item245>
-      <Item246>
+      </Item246>
+      <Item247>
         <Filename Value="win32/win32wsforms.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSForms"/>
-      </Item246>
-      <Item247>
+      </Item247>
+      <Item248>
         <Filename Value="win32/win32wsgrids.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSGrids"/>
-      </Item247>
-      <Item248>
+      </Item248>
+      <Item249>
         <Filename Value="win32/win32wsimglist.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSImgList"/>
-      </Item248>
-      <Item249>
+      </Item249>
+      <Item250>
         <Filename Value="win32/win32wsmenus.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSMenus"/>
-      </Item249>
-      <Item250>
+      </Item250>
+      <Item251>
         <Filename Value="win32/win32wspairsplitter.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSPairSplitter"/>
-      </Item250>
-      <Item251>
+      </Item251>
+      <Item252>
         <Filename Value="win32/win32wsspin.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSSpin"/>
-      </Item251>
-      <Item252>
+      </Item252>
+      <Item253>
         <Filename Value="win32/win32wsstdctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSStdCtrls"/>
-      </Item252>
-      <Item253>
+      </Item253>
+      <Item254>
         <Filename Value="win32/win32wstoolwin.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Win32WSToolwin"/>
-      </Item253>
-      <Item254>
+      </Item254>
+      <Item255>
         <Filename Value="wince/interfaces.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Interfaces"/>
-      </Item254>
-      <Item255>
+      </Item255>
+      <Item256>
         <Filename Value="wince/win32compat.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="win32compat"/>
-      </Item255>
-      <Item256>
+      </Item256>
+      <Item257>
         <Filename Value="wince/wincecallback.inc"/>
         <Type Value="Include"/>
-      </Item256>
-      <Item257>
+      </Item257>
+      <Item258>
         <Filename Value="wince/wincedef.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEDef"/>
-      </Item257>
-      <Item258>
+      </Item258>
+      <Item259>
         <Filename Value="wince/winceextra.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEExtra"/>
-      </Item258>
-      <Item259>
+      </Item259>
+      <Item260>
         <Filename Value="wince/winceint.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEInt"/>
-      </Item259>
-      <Item260>
-        <Filename Value="wince/wincelclintf.inc"/>
-        <Type Value="Include"/>
       </Item260>
       <Item261>
-        <Filename Value="wince/wincelclintfh.inc"/>
+        <Filename Value="wince/wincelclintf.inc"/>
         <Type Value="Include"/>
       </Item261>
       <Item262>
-        <Filename Value="wince/wincelistsl.inc"/>
+        <Filename Value="wince/wincelclintfh.inc"/>
         <Type Value="Include"/>
       </Item262>
       <Item263>
-        <Filename Value="wince/wincelistslh.inc"/>
+        <Filename Value="wince/wincelistsl.inc"/>
         <Type Value="Include"/>
       </Item263>
       <Item264>
-        <Filename Value="wince/wincememostrings.inc"/>
+        <Filename Value="wince/wincelistslh.inc"/>
         <Type Value="Include"/>
       </Item264>
       <Item265>
-        <Filename Value="wince/winceobject.inc"/>
+        <Filename Value="wince/wincememostrings.inc"/>
         <Type Value="Include"/>
       </Item265>
       <Item266>
+        <Filename Value="wince/winceobject.inc"/>
+        <Type Value="Include"/>
+      </Item266>
+      <Item267>
         <Filename Value="wince/winceproc.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="winceproc"/>
-      </Item266>
-      <Item267>
-        <Filename Value="wince/wincewinapi.inc"/>
-        <Type Value="Include"/>
       </Item267>
       <Item268>
-        <Filename Value="wince/wincewinapih.inc"/>
+        <Filename Value="wince/wincewinapi.inc"/>
         <Type Value="Include"/>
       </Item268>
       <Item269>
+        <Filename Value="wince/wincewinapih.inc"/>
+        <Type Value="Include"/>
+      </Item269>
+      <Item270>
         <Filename Value="wince/wincewsbuttons.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSButtons"/>
-      </Item269>
-      <Item270>
+      </Item270>
+      <Item271>
         <Filename Value="wince/wincewscalendar.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSCalendar"/>
-      </Item270>
-      <Item271>
+      </Item271>
+      <Item272>
         <Filename Value="wince/wincewschecklst.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSCheckLst"/>
-      </Item271>
-      <Item272>
+      </Item272>
+      <Item273>
         <Filename Value="wince/wincewscomctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSComCtrls"/>
-      </Item272>
-      <Item273>
+      </Item273>
+      <Item274>
         <Filename Value="wince/wincewscontrols.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSControls"/>
-      </Item273>
-      <Item274>
+      </Item274>
+      <Item275>
         <Filename Value="wince/wincewscustomlistview.inc"/>
         <Type Value="Include"/>
-      </Item274>
-      <Item275>
+      </Item275>
+      <Item276>
         <Filename Value="wince/wincewsdialogs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSDialogs"/>
-      </Item275>
-      <Item276>
+      </Item276>
+      <Item277>
         <Filename Value="wince/wincewsextctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSExtCtrls"/>
-      </Item276>
-      <Item277>
+      </Item277>
+      <Item278>
         <Filename Value="wince/wincewsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSFactory"/>
-      </Item277>
-      <Item278>
+      </Item278>
+      <Item279>
         <Filename Value="wince/wincewsforms.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSForms"/>
-      </Item278>
-      <Item279>
+      </Item279>
+      <Item280>
         <Filename Value="wince/wincewsgrids.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSGrids"/>
-      </Item279>
-      <Item280>
+      </Item280>
+      <Item281>
         <Filename Value="wince/wincewsimglist.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="wincewsimglist"/>
-      </Item280>
-      <Item281>
+      </Item281>
+      <Item282>
         <Filename Value="wince/wincewsmenus.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSMenus"/>
-      </Item281>
-      <Item282>
+      </Item282>
+      <Item283>
         <Filename Value="wince/wincewsspin.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSSpin"/>
-      </Item282>
-      <Item283>
+      </Item283>
+      <Item284>
         <Filename Value="wince/wincewsstdctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinCEWSStdCtrls"/>
-      </Item283>
-      <Item284>
+      </Item284>
+      <Item285>
         <Filename Value="wince/winext.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="WinExt"/>
-      </Item284>
-      <Item285>
+      </Item285>
+      <Item286>
         <Filename Value="wince/alllclintfunits.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="AllLCLIntfUnits"/>
-      </Item285>
-      <Item286>
+      </Item286>
+      <Item287>
         <Filename Value="qt/alllclintfunits.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="AllLCLIntfUnits"/>
-      </Item286>
-      <Item287>
+      </Item287>
+      <Item288>
         <Filename Value="qt/interfaces.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="interfaces"/>
-      </Item287>
-      <Item288>
+      </Item288>
+      <Item289>
         <Filename Value="qt/qt4.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qt4"/>
-      </Item288>
-      <Item289>
+      </Item289>
+      <Item290>
         <Filename Value="qt/qt45.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qt45"/>
-      </Item289>
-      <Item290>
+      </Item290>
+      <Item291>
         <Filename Value="qt/qtcaret.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtCaret"/>
-      </Item290>
-      <Item291>
+      </Item291>
+      <Item292>
         <Filename Value="qt/qtdefines.inc"/>
         <Type Value="Include"/>
-      </Item291>
-      <Item292>
+      </Item292>
+      <Item293>
         <Filename Value="qt/qtint.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtint"/>
-      </Item292>
-      <Item293>
-        <Filename Value="qt/qtlclintf.inc"/>
-        <Type Value="Include"/>
       </Item293>
       <Item294>
-        <Filename Value="qt/qtlclintfh.inc"/>
+        <Filename Value="qt/qtlclintf.inc"/>
         <Type Value="Include"/>
       </Item294>
       <Item295>
-        <Filename Value="qt/qtobject.inc"/>
+        <Filename Value="qt/qtlclintfh.inc"/>
         <Type Value="Include"/>
       </Item295>
       <Item296>
+        <Filename Value="qt/qtobject.inc"/>
+        <Type Value="Include"/>
+      </Item296>
+      <Item297>
         <Filename Value="qt/qtobjects.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtobjects"/>
-      </Item296>
-      <Item297>
+      </Item297>
+      <Item298>
         <Filename Value="qt/qtprivate.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtprivate"/>
-      </Item297>
-      <Item298>
+      </Item298>
+      <Item299>
         <Filename Value="qt/qtproc.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtproc"/>
-      </Item298>
-      <Item299>
+      </Item299>
+      <Item300>
         <Filename Value="qt/qtthemes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtThemes"/>
-      </Item299>
-      <Item300>
+      </Item300>
+      <Item301>
         <Filename Value="qt/qtwidgets.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtwidgets"/>
-      </Item300>
-      <Item301>
-        <Filename Value="qt/qtwinapi.inc"/>
-        <Type Value="Include"/>
       </Item301>
       <Item302>
-        <Filename Value="qt/qtwinapih.inc"/>
+        <Filename Value="qt/qtwinapi.inc"/>
         <Type Value="Include"/>
       </Item302>
       <Item303>
+        <Filename Value="qt/qtwinapih.inc"/>
+        <Type Value="Include"/>
+      </Item303>
+      <Item304>
         <Filename Value="qt/qtwsbuttons.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSButtons"/>
-      </Item303>
-      <Item304>
+      </Item304>
+      <Item305>
         <Filename Value="qt/qtwscalendar.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSCalendar"/>
-      </Item304>
-      <Item305>
+      </Item305>
+      <Item306>
         <Filename Value="qt/qtwschecklst.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSCheckLst"/>
-      </Item305>
-      <Item306>
+      </Item306>
+      <Item307>
         <Filename Value="qt/qtwscomctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSComCtrls"/>
-      </Item306>
-      <Item307>
+      </Item307>
+      <Item308>
         <Filename Value="qt/qtpagecontrol.inc"/>
         <Type Value="Include"/>
-      </Item307>
-      <Item308>
+      </Item308>
+      <Item309>
         <Filename Value="qt/qtwscontrols.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSControls"/>
-      </Item308>
-      <Item309>
+      </Item309>
+      <Item310>
         <Filename Value="qt/qtwsdesigner.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSDesigner"/>
-      </Item309>
-      <Item310>
+      </Item310>
+      <Item311>
         <Filename Value="qt/qtwsdialogs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSDialogs"/>
-      </Item310>
-      <Item311>
+      </Item311>
+      <Item312>
         <Filename Value="qt/qtwsextctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSExtCtrls"/>
-      </Item311>
-      <Item312>
+      </Item312>
+      <Item313>
         <Filename Value="qt/qtwsextdlgs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSExtDlgs"/>
-      </Item312>
-      <Item313>
+      </Item313>
+      <Item314>
         <Filename Value="qt/qtwsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSFactory"/>
-      </Item313>
-      <Item314>
+      </Item314>
+      <Item315>
         <Filename Value="qt/qtwsforms.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSForms"/>
-      </Item314>
-      <Item315>
+      </Item315>
+      <Item316>
         <Filename Value="qt/qtwsgrids.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSGrids"/>
-      </Item315>
-      <Item316>
+      </Item316>
+      <Item317>
         <Filename Value="qt/qtwsimglist.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSImgList"/>
-      </Item316>
-      <Item317>
+      </Item317>
+      <Item318>
         <Filename Value="qt/qtwsmenus.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSMenus"/>
-      </Item317>
-      <Item318>
+      </Item318>
+      <Item319>
         <Filename Value="qt/qtwspairsplitter.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSPairSplitter"/>
-      </Item318>
-      <Item319>
+      </Item319>
+      <Item320>
         <Filename Value="qt/qtwsspin.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSSpin"/>
-      </Item319>
-      <Item320>
+      </Item320>
+      <Item321>
         <Filename Value="qt/qtwsstdctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="QtWSStdCtrls"/>
-      </Item320>
-      <Item321>
+      </Item321>
+      <Item322>
         <Filename Value="qt/qtx11.inc"/>
         <Type Value="Include"/>
-      </Item321>
-      <Item322>
+      </Item322>
+      <Item323>
         <Filename Value="cocoa/cocoawsbuttons.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="cocoawsbuttons"/>
-      </Item322>
-      <Item323>
+      </Item323>
+      <Item324>
         <Filename Value="customdrawn/wincallback.inc"/>
         <Type Value="Include"/>
-      </Item323>
-      <Item324>
+      </Item324>
+      <Item325>
         <Filename Value="customdrawn/customdrawn_winproc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawn_winproc"/>
-      </Item324>
-      <Item325>
+      </Item325>
+      <Item326>
         <Filename Value="customdrawn/alllclintfunits.pas"/>
         <UnitName Value="AllLCLIntfUnits"/>
-      </Item325>
-      <Item326>
+      </Item326>
+      <Item327>
         <Filename Value="customdrawn/customdrawndefines.inc"/>
         <Type Value="Include"/>
-      </Item326>
-      <Item327>
+      </Item327>
+      <Item328>
         <Filename Value="customdrawn/customdrawnint.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnInt"/>
-      </Item327>
-      <Item328>
-        <Filename Value="customdrawn/customdrawnobject.inc"/>
-        <Type Value="Include"/>
       </Item328>
       <Item329>
-        <Filename Value="customdrawn/customdrawnobject_cocoa.inc"/>
+        <Filename Value="customdrawn/customdrawnobject.inc"/>
         <Type Value="Include"/>
       </Item329>
       <Item330>
-        <Filename Value="customdrawn/customdrawnobject_win.inc"/>
+        <Filename Value="customdrawn/customdrawnobject_cocoa.inc"/>
         <Type Value="Include"/>
       </Item330>
       <Item331>
+        <Filename Value="customdrawn/customdrawnobject_win.inc"/>
+        <Type Value="Include"/>
+      </Item331>
+      <Item332>
         <Filename Value="customdrawn/customdrawnwscontrols.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSControls"/>
-      </Item331>
-      <Item332>
+      </Item332>
+      <Item333>
         <Filename Value="customdrawn/customdrawnwsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSFactory"/>
-      </Item332>
-      <Item333>
+      </Item333>
+      <Item334>
         <Filename Value="customdrawn/customdrawnwsforms.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSForms"/>
-      </Item333>
-      <Item334>
+      </Item334>
+      <Item335>
         <Filename Value="customdrawn/interfaces.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Interfaces"/>
-      </Item334>
-      <Item335>
+      </Item335>
+      <Item336>
         <Filename Value="customdrawn/customdrawnwsforms_win.inc"/>
         <Type Value="Include"/>
         <UnitName Value="customdrawnwsforms_win"/>
-      </Item335>
-      <Item336>
+      </Item336>
+      <Item337>
         <Filename Value="customdrawn/customdrawnwsforms_x11.inc"/>
         <Type Value="Include"/>
         <UnitName Value="customdrawnwsforms_x11"/>
-      </Item336>
-      <Item337>
+      </Item337>
+      <Item338>
         <Filename Value="customdrawn/customdrawnobject_x11.inc"/>
         <Type Value="Include"/>
         <UnitName Value="customdrawnobject_x11"/>
-      </Item337>
-      <Item338>
+      </Item338>
+      <Item339>
         <Filename Value="customdrawn/cocoagdiobjects.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaGDIObjects"/>
-      </Item338>
-      <Item339>
+      </Item339>
+      <Item340>
         <Filename Value="customdrawn/customdrawn_cocoaproc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawn_cocoaproc"/>
-      </Item339>
-      <Item340>
+      </Item340>
+      <Item341>
         <Filename Value="customdrawn/cocoautils.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaUtils"/>
-      </Item340>
-      <Item341>
-        <Filename Value="customdrawn/customdrawnlclintf.inc"/>
-        <Type Value="Include"/>
       </Item341>
       <Item342>
-        <Filename Value="customdrawn/customdrawnlclintfh.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintf.inc"/>
         <Type Value="Include"/>
       </Item342>
       <Item343>
-        <Filename Value="customdrawn/customdrawnwinapi_cocoa.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintfh.inc"/>
         <Type Value="Include"/>
       </Item343>
       <Item344>
-        <Filename Value="customdrawn/customdrawnwinapi_win.inc"/>
+        <Filename Value="customdrawn/customdrawnwinapi_cocoa.inc"/>
         <Type Value="Include"/>
       </Item344>
       <Item345>
-        <Filename Value="customdrawn/customdrawnwinapi.inc"/>
+        <Filename Value="customdrawn/customdrawnwinapi_win.inc"/>
         <Type Value="Include"/>
       </Item345>
       <Item346>
-        <Filename Value="customdrawn/customdrawnwinapih.inc"/>
+        <Filename Value="customdrawn/customdrawnwinapi.inc"/>
         <Type Value="Include"/>
       </Item346>
       <Item347>
-        <Filename Value="customdrawn/customdrawnwsforms_cocoa.inc"/>
+        <Filename Value="customdrawn/customdrawnwinapih.inc"/>
         <Type Value="Include"/>
       </Item347>
       <Item348>
+        <Filename Value="customdrawn/customdrawnwsforms_cocoa.inc"/>
+        <Type Value="Include"/>
+      </Item348>
+      <Item349>
         <Filename Value="customdrawn/customdrawnproc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawnproc"/>
-      </Item348>
-      <Item349>
+      </Item349>
+      <Item350>
         <Filename Value="customdrawn/customdrawn_x11proc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawn_x11proc"/>
-      </Item349>
-      <Item350>
+      </Item350>
+      <Item351>
         <Filename Value="customdrawn/customdrawnwinapi_x11.inc"/>
         <Type Value="Include"/>
-      </Item350>
-      <Item351>
+      </Item351>
+      <Item352>
         <Filename Value="customdrawn/customdrawn_androidproc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawn_androidproc"/>
-      </Item351>
-      <Item352>
-        <Filename Value="customdrawn/customdrawnobject_android.inc"/>
-        <Type Value="Include"/>
       </Item352>
       <Item353>
-        <Filename Value="customdrawn/customdrawnwinapi_android.inc"/>
+        <Filename Value="customdrawn/customdrawnobject_android.inc"/>
         <Type Value="Include"/>
       </Item353>
       <Item354>
-        <Filename Value="customdrawn/customdrawnwsforms_android.inc"/>
+        <Filename Value="customdrawn/customdrawnwinapi_android.inc"/>
         <Type Value="Include"/>
       </Item354>
       <Item355>
+        <Filename Value="customdrawn/customdrawnwsforms_android.inc"/>
+        <Type Value="Include"/>
+      </Item355>
+      <Item356>
         <Filename Value="customdrawn/android/android_native_app_glue.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="android_native_app_glue"/>
-      </Item355>
-      <Item356>
+      </Item356>
+      <Item357>
         <Filename Value="customdrawn/android/asset_manager.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="asset_manager"/>
-      </Item356>
-      <Item357>
+      </Item357>
+      <Item358>
         <Filename Value="customdrawn/android/configuration.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="configuration"/>
-      </Item357>
-      <Item358>
+      </Item358>
+      <Item359>
         <Filename Value="customdrawn/android/egl.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="egl"/>
-      </Item358>
-      <Item359>
+      </Item359>
+      <Item360>
         <Filename Value="customdrawn/android/gles.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gles"/>
-      </Item359>
-      <Item360>
+      </Item360>
+      <Item361>
         <Filename Value="customdrawn/android/input.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="input"/>
-      </Item360>
-      <Item361>
+      </Item361>
+      <Item362>
         <Filename Value="customdrawn/android/jni.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="jni"/>
-      </Item361>
-      <Item362>
+      </Item362>
+      <Item363>
         <Filename Value="customdrawn/android/keycodes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="keycodes"/>
-      </Item362>
-      <Item363>
+      </Item363>
+      <Item364>
         <Filename Value="customdrawn/android/log.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="log"/>
-      </Item363>
-      <Item364>
+      </Item364>
+      <Item365>
         <Filename Value="customdrawn/android/looper.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="looper"/>
-      </Item364>
-      <Item365>
+      </Item365>
+      <Item366>
         <Filename Value="customdrawn/android/native_activity.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="native_activity"/>
-      </Item365>
-      <Item366>
+      </Item366>
+      <Item367>
         <Filename Value="customdrawn/android/native_window.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="native_window"/>
-      </Item366>
-      <Item367>
+      </Item367>
+      <Item368>
         <Filename Value="customdrawn/android/rect.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="rect"/>
-      </Item367>
-      <Item368>
+      </Item368>
+      <Item369>
         <Filename Value="customdrawn/android/bitmap.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="bitmap"/>
-      </Item368>
-      <Item369>
+      </Item369>
+      <Item370>
         <Filename Value="customdrawn/customdrawnwsstdctrls.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSStdCtrls"/>
-      </Item369>
-      <Item370>
+      </Item370>
+      <Item371>
         <Filename Value="customdrawn/customdrawnwscomctrls.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSComCtrls"/>
-      </Item370>
-      <Item371>
+      </Item371>
+      <Item372>
         <Filename Value="customdrawn/customdrawnwsextctrls.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSExtCtrls"/>
-      </Item371>
-      <Item372>
+      </Item372>
+      <Item373>
         <Filename Value="customdrawn/customdrawnprivate.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawnprivate"/>
-      </Item372>
-      <Item373>
-        <Filename Value="customdrawn/customdrawnlclintf_android.inc"/>
-        <Type Value="Include"/>
       </Item373>
       <Item374>
-        <Filename Value="customdrawn/customdrawnlclintf_cocoa.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintf_android.inc"/>
         <Type Value="Include"/>
       </Item374>
       <Item375>
-        <Filename Value="customdrawn/customdrawnlclintf_win.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintf_cocoa.inc"/>
         <Type Value="Include"/>
       </Item375>
       <Item376>
-        <Filename Value="customdrawn/customdrawnlclintf_x11.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintf_win.inc"/>
         <Type Value="Include"/>
       </Item376>
       <Item377>
-        <Filename Value="customdrawn/customdrawntrayicon_android.inc"/>
+        <Filename Value="customdrawn/customdrawnlclintf_x11.inc"/>
         <Type Value="Include"/>
       </Item377>
       <Item378>
-        <Filename Value="customdrawn/customdrawntrayicon_cocoa.inc"/>
+        <Filename Value="customdrawn/customdrawntrayicon_android.inc"/>
         <Type Value="Include"/>
       </Item378>
       <Item379>
-        <Filename Value="customdrawn/customdrawntrayicon_win.inc"/>
+        <Filename Value="customdrawn/customdrawntrayicon_cocoa.inc"/>
         <Type Value="Include"/>
       </Item379>
       <Item380>
+        <Filename Value="customdrawn/customdrawntrayicon_win.inc"/>
+        <Type Value="Include"/>
+      </Item380>
+      <Item381>
         <Filename Value="cocoa/cocoacaret.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaCaret"/>
-      </Item380>
-      <Item381>
+      </Item381>
+      <Item382>
         <Filename Value="customdrawn/customdrawntrayicon_x11.inc"/>
         <Type Value="Include"/>
-      </Item381>
-      <Item382>
+      </Item382>
+      <Item383>
         <Filename Value="customdrawn/customdrawnwslazdeviceapis.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSLazDeviceAPIS"/>
-      </Item382>
-      <Item383>
+      </Item383>
+      <Item384>
         <Filename Value="nogui/alllclintfunits.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="AllLCLIntfUnits"/>
-      </Item383>
-      <Item384>
+      </Item384>
+      <Item385>
         <Filename Value="nogui/interfaces.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Interfaces"/>
-      </Item384>
-      <Item385>
+      </Item385>
+      <Item386>
         <Filename Value="nogui/noguiint.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="NoGUIInt"/>
-      </Item385>
-      <Item386>
+      </Item386>
+      <Item387>
         <Filename Value="nogui/noguiwsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="NoGUIWSFactory"/>
-      </Item386>
-      <Item387>
+      </Item387>
+      <Item388>
         <Filename Value="customdrawn/customdrawnwsspin.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawnwsspin"/>
-      </Item387>
-      <Item388>
+      </Item388>
+      <Item389>
         <Filename Value="customdrawn/customdrawnwsbuttons.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawnwsbuttons"/>
-      </Item388>
-      <Item389>
+      </Item389>
+      <Item390>
         <Filename Value="customdrawn/customdrawnwsdialogs.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="customdrawnwsdialogs"/>
-      </Item389>
-      <Item390>
+      </Item390>
+      <Item391>
         <Filename Value="customdrawn/customdrawnwsmenus_cocoa.inc"/>
         <Type Value="Include"/>
-      </Item390>
-      <Item391>
+      </Item391>
+      <Item392>
         <Filename Value="customdrawn/customdrawnwsmenus.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CustomDrawnWSMenus"/>
-      </Item391>
-      <Item392>
+      </Item392>
+      <Item393>
         <Filename Value="gtk2/gtk2disableliboverlay.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk2disableliboverlay"/>
-      </Item392>
-      <Item393>
+      </Item393>
+      <Item394>
         <Filename Value="gtk3/gtk3int.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk3int"/>
-      </Item393>
-      <Item394>
+      </Item394>
+      <Item395>
         <Filename Value="gtk3/gtk3winapih.inc"/>
         <Type Value="Include"/>
-      </Item394>
-      <Item395>
+      </Item395>
+      <Item396>
         <Filename Value="gtk3/interfaces.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="interfaces"/>
-      </Item395>
-      <Item396>
+      </Item396>
+      <Item397>
         <Filename Value="gtk3/gtk3cellrenderer.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3CellRenderer"/>
-      </Item396>
-      <Item397>
-        <Filename Value="gtk3/gtk3lclintf.inc"/>
-        <Type Value="Include"/>
       </Item397>
       <Item398>
-        <Filename Value="gtk3/gtk3lclintfh.inc"/>
+        <Filename Value="gtk3/gtk3lclintf.inc"/>
         <Type Value="Include"/>
       </Item398>
       <Item399>
-        <Filename Value="gtk3/gtk3object.inc"/>
+        <Filename Value="gtk3/gtk3lclintfh.inc"/>
         <Type Value="Include"/>
       </Item399>
       <Item400>
+        <Filename Value="gtk3/gtk3object.inc"/>
+        <Type Value="Include"/>
+      </Item400>
+      <Item401>
         <Filename Value="gtk3/gtk3objects.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk3objects"/>
-      </Item400>
-      <Item401>
+      </Item401>
+      <Item402>
         <Filename Value="gtk3/gtk3private.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk3private"/>
-      </Item401>
-      <Item402>
+      </Item402>
+      <Item403>
         <Filename Value="gtk3/gtk3procs.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk3procs"/>
-      </Item402>
-      <Item403>
+      </Item403>
+      <Item404>
         <Filename Value="gtk3/gtk3widgets.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="gtk3widgets"/>
-      </Item403>
-      <Item404>
+      </Item404>
+      <Item405>
         <Filename Value="gtk3/gtk3winapi.inc"/>
         <Type Value="Include"/>
-      </Item404>
-      <Item405>
+      </Item405>
+      <Item406>
         <Filename Value="gtk3/gtk3wsbuttons.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSButtons"/>
-      </Item405>
-      <Item406>
+      </Item406>
+      <Item407>
         <Filename Value="gtk3/gtk3wschecklst.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSCheckLst"/>
-      </Item406>
-      <Item407>
+      </Item407>
+      <Item408>
         <Filename Value="gtk3/gtk3wscomctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSComCtrls"/>
-      </Item407>
-      <Item408>
+      </Item408>
+      <Item409>
         <Filename Value="gtk3/gtk3wscontrols.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSControls"/>
-      </Item408>
-      <Item409>
+      </Item409>
+      <Item410>
         <Filename Value="gtk3/gtk3wsextctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSExtCtrls"/>
-      </Item409>
-      <Item410>
+      </Item410>
+      <Item411>
         <Filename Value="gtk3/gtk3wsfactory.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSFactory"/>
-      </Item410>
-      <Item411>
+      </Item411>
+      <Item412>
         <Filename Value="gtk3/gtk3wsforms.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSForms"/>
-      </Item411>
-      <Item412>
+      </Item412>
+      <Item413>
         <Filename Value="gtk3/gtk3wsimglist.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSImgList"/>
-      </Item412>
-      <Item413>
+      </Item413>
+      <Item414>
         <Filename Value="gtk3/gtk3wsmenus.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSMenus"/>
-      </Item413>
-      <Item414>
+      </Item414>
+      <Item415>
         <Filename Value="gtk3/gtk3wsspin.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSSpin"/>
-      </Item414>
-      <Item415>
+      </Item415>
+      <Item416>
         <Filename Value="gtk3/gtk3wsstdctrls.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSStdCtrls"/>
-      </Item415>
-      <Item416>
+      </Item416>
+      <Item417>
         <Filename Value="gtk3/gtk3defines.inc"/>
         <Type Value="Include"/>
-      </Item416>
-      <Item417>
+      </Item417>
+      <Item418>
         <Filename Value="gtk3/gtk3wscalendar.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSCalendar"/>
-      </Item417>
-      <Item418>
+      </Item418>
+      <Item419>
         <Filename Value="gtk3/gtk3bindings/lazatk1.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazAtk1"/>
-      </Item418>
-      <Item419>
+      </Item419>
+      <Item420>
         <Filename Value="gtk3/gtk3bindings/lazcairo1.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazCairo1"/>
-      </Item419>
-      <Item420>
+      </Item420>
+      <Item421>
         <Filename Value="gtk3/gtk3bindings/lazgdk3.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGdk3"/>
-      </Item420>
-      <Item421>
+      </Item421>
+      <Item422>
         <Filename Value="gtk3/gtk3bindings/lazgdkpixbuf2.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGdkPixbuf2"/>
-      </Item421>
-      <Item422>
+      </Item422>
+      <Item423>
         <Filename Value="gtk3/gtk3bindings/lazgio2.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGio2"/>
-      </Item422>
-      <Item423>
+      </Item423>
+      <Item424>
         <Filename Value="gtk3/gtk3bindings/lazglib2.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGLib2"/>
-      </Item423>
-      <Item424>
+      </Item424>
+      <Item425>
         <Filename Value="gtk3/gtk3bindings/lazgmodule2.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGModule2"/>
-      </Item424>
-      <Item425>
+      </Item425>
+      <Item426>
         <Filename Value="gtk3/gtk3bindings/lazgobject2.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGObject2"/>
-      </Item425>
-      <Item426>
+      </Item426>
+      <Item427>
         <Filename Value="gtk3/gtk3bindings/lazgtk3.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazGtk3"/>
-      </Item426>
-      <Item427>
+      </Item427>
+      <Item428>
         <Filename Value="cocoa/cocoawsdialogs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaWSDialogs"/>
-      </Item427>
-      <Item428>
+      </Item428>
+      <Item429>
         <Filename Value="gtk3/gtk3bindings/lazpango1.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazPango1"/>
-      </Item428>
-      <Item429>
+      </Item429>
+      <Item430>
         <Filename Value="gtk3/gtk3bindings/lazpangocairo1.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="LazPangoCairo1"/>
-      </Item429>
-      <Item430>
-        <Filename Value="cocoa/cocoalclintf.inc"/>
-        <Type Value="Include"/>
       </Item430>
       <Item431>
-        <Filename Value="cocoa/cocoalclintfh.inc"/>
+        <Filename Value="cocoa/cocoalclintf.inc"/>
         <Type Value="Include"/>
       </Item431>
       <Item432>
+        <Filename Value="cocoa/cocoalclintfh.inc"/>
+        <Type Value="Include"/>
+      </Item432>
+      <Item433>
         <Filename Value="cocoa/cocoaproc.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaProc"/>
-      </Item432>
-      <Item433>
+      </Item433>
+      <Item434>
         <Filename Value="cocoa/cocoathemes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaThemes"/>
-      </Item433>
-      <Item434>
+      </Item434>
+      <Item435>
         <Filename Value="cocoa/cocoawscomctrls.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="CocoaWSComCtrls"/>
-      </Item434>
-      <Item435>
+      </Item435>
+      <Item436>
         <Filename Value="cocoa/mackeycodes.inc"/>
         <Type Value="Include"/>
-      </Item435>
-      <Item436>
+      </Item436>
+      <Item437>
         <Filename Value="qt/qtsystemtrayicon.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="qtsystemtrayicon"/>
-      </Item436>
-      <Item437>
+      </Item437>
+      <Item438>
         <Filename Value="gtk3/gtk3wsdialogs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSDialogs"/>
-      </Item437>
-      <Item438>
+      </Item438>
+      <Item439>
         <Filename Value="gtk3/gtk3wsextdlgs.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="Gtk3WSExtDlgs"/>
-      </Item438>
+      </Item439>
     </Files>
     <LazDoc Paths="../../docs/xml/lcl"/>
     <i18n>
unitytray.patch (47,522 bytes)   

Anthony Walter

2016-02-06 08:38

reporter  

unitywsctrls.pas (10,618 bytes)   
{ Copyleft implementation of TTrayIcon for
  Unity applications indicators
  Created 2015 by Anthony Walter sysrpl@gmail.com }

unit UnityWSCtrls;

interface

{$mode delphi}
uses
  GLib2, Gtk2, Gdk2, Gdk2Pixbuf,
  Classes, SysUtils, Graphics,
  Controls, Forms, ExtCtrls, WSExtCtrls, LCLType;

{ TUnityWSCustomTrayIcon is the class for tray icons on systems
  running the Unity desktop environment.

  Unity allows only AppIndicator objects in its tray. These objects
  have the following reduced functionality:

  Tooltips are not allowed
  Icons do not receive mouse events
  Indicators display a menu when clicked by any mouse button

  See also: http://www.markshuttleworth.com/archives/347
  "Clicking on an indicator will open its menu..."
  "There’ll be no ability for arbitrary applications to define arbitrary
   behaviours to arbitrary events on indicators"

  Personal observations:

  A popup menu is required always
  You can only create one AppIndicator per appplication
  You cannot use a different popupmenu once one has been used }

type
  TUnityWSCustomTrayIcon = class(TWSCustomTrayIcon)
  published
    class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; override;
    class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; override;
    class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); override;
    class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; override;
  end;

{ UnityAppIndicatorInit returns true if appindicator libraries can be loaded }

function UnityAppIndicatorInit: Boolean;

implementation

const
  libappindicator = 'libappindicator.so.1';

const
  APP_INDICATOR_SIGNAL_NEW_ICON = 'new-icon';
  APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON = 'new-attention-icon';
  APP_INDICATOR_SIGNAL_NEW_STATUS = 'new-status';
  APP_INDICATOR_SIGNAL_NEW_LABEL = 'new-label';
  APP_INDICATOR_SIGNAL_CONNECTION_CHANGED = 'connection-changed';
  APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH = 'new-icon-theme-path';

type
  TAppIndicatorCategory = (
    APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
    APP_INDICATOR_CATEGORY_COMMUNICATIONS,
    APP_INDICATOR_CATEGORY_SYSTEM_SERVICES,
    APP_INDICATOR_CATEGORY_HARDWARE,
    APP_INDICATOR_CATEGORY_OTHER
  );

  TAppIndicatorStatus = (
    APP_INDICATOR_STATUS_PASSIVE,
    APP_INDICATOR_STATUS_ACTIVE,
    APP_INDICATOR_STATUS_ATTENTION
  );

  PAppIndicator = Pointer;

var
  { GlobalAppIndicator creation routines }
  app_indicator_get_type: function: GType; cdecl;
  app_indicator_new: function(id, icon_name: PGChar; category: TAppIndicatorCategory): PAppIndicator; cdecl;
  app_indicator_new_with_path: function(id, icon_name: PGChar; category: TAppIndicatorCategory; icon_theme_path: PGChar): PAppIndicator; cdecl;
  { Set properties }
  app_indicator_set_status: procedure(self: PAppIndicator; status: TAppIndicatorStatus); cdecl;
  app_indicator_set_attention_icon: procedure(self: PAppIndicator; icon_name: PGChar); cdecl;
  app_indicator_set_menu: procedure(self: PAppIndicator; menu: PGtkMenu); cdecl;
  app_indicator_set_icon: procedure(self: PAppIndicator; icon_name: PGChar); cdecl;
  app_indicator_set_label: procedure(self: PAppIndicator; _label, guide: PGChar); cdecl;
  app_indicator_set_icon_theme_path: procedure(self: PAppIndicator; icon_theme_path: PGChar); cdecl;
  app_indicator_set_ordering_index: procedure(self: PAppIndicator; ordering_index: guint32); cdecl;
  { Get properties }
  app_indicator_get_id: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_category: function(self: PAppIndicator): TAppIndicatorCategory; cdecl;
  app_indicator_get_status: function(self: PAppIndicator): TAppIndicatorStatus; cdecl;
  app_indicator_get_icon: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_icon_theme_path: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_attention_icon: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_menu: function(self: PAppIndicator): PGtkMenu; cdecl;
  app_indicator_get_label: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_label_guide: function(self: PAppIndicator): PGChar; cdecl;
  app_indicator_get_ordering_index: function(self: PAppIndicator): guint32; cdecl;

{ TUnityTrayIconHandle }

type
  TUnityTrayIconHandle = class
  private
    FTrayIcon: TCustomTrayIcon;
    FName: string;
    FIconName: string;
  public
    constructor Create(TrayIcon: TCustomTrayIcon);
    destructor Destroy; override;
    procedure Update;
  end;

{ It seems to me, and please tell me otherwise if untrue, that the only way
  to load icons for AppIndicator is through files }

const
  IconThemePath = '/tmp/appindicators/';
  IconType = 'png';

{ It seems to me, and please tell me otherwise if untrue, that you can only
  create one working AppIndicator for your program over its lifetime }

var
  GlobalAppIndicator: PAppIndicator;
  GlobalIcon: Pointer;
  GlobalIconPath: string;

constructor TUnityTrayIconHandle.Create(TrayIcon: TCustomTrayIcon);
var
  NewIcon: Pointer;
begin
  inherited Create;
  FTrayIcon := TrayIcon;
  FName := 'app-' + IntToHex(IntPtr(Application), SizeOf(IntPtr) * 2);
  NewIcon := Pointer(FTrayIcon.Icon.Handle);
  if NewIcon = nil then
    NewIcon := Pointer(Application.Icon.Handle);
  if NewIcon <> GlobalIcon then
  begin
    GlobalIcon := NewIcon;
    ForceDirectories(IconThemePath);
    FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
    if FileExists(GlobalIconPath) then
      DeleteFile(GlobalIconPath);
    GlobalIconPath := IconThemePath + FIconName + '.' + IconType;
    gdk_pixbuf_save(GlobalIcon, PChar(GlobalIconPath), IconType, nil);
    if GlobalAppIndicator <> nil then
      app_indicator_set_icon(GlobalAppIndicator, PChar(FIconName));
  end
  else
    FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
  { Only the first created AppIndicator is functional }
  if GlobalAppIndicator = nil then
    { It seems that icons can only come from files :( }
    GlobalAppIndicator := app_indicator_new_with_path(PChar(FName), PChar(FIconName),
      APP_INDICATOR_CATEGORY_APPLICATION_STATUS, IconThemePath);
  Update;
end;

destructor TUnityTrayIconHandle.Destroy;
begin
  { Hide the global AppIndicator }
  app_indicator_set_status(GlobalAppIndicator, APP_INDICATOR_STATUS_PASSIVE);
  inherited Destroy;
end;

procedure TUnityTrayIconHandle.Update;
var
  NewIcon: Pointer;
begin
  NewIcon := Pointer(FTrayIcon.Icon.Handle);
  if NewIcon = nil then
    NewIcon := Pointer(Application.Icon.Handle);
  if NewIcon <> GlobalIcon then
  begin
    GlobalIcon := NewIcon;
    FIconName := FName + '-' + IntToHex(IntPtr(GlobalIcon), SizeOf(GlobalIcon) * 2);
    ForceDirectories(IconThemePath);
    if FileExists(GlobalIconPath) then
      DeleteFile(GlobalIconPath);
    GlobalIconPath := IconThemePath + FIconName + '.' + IconType;
    gdk_pixbuf_save(GlobalIcon, PChar(GlobalIconPath), IconType, nil);
    { Again it seems that icons can only come from files }
    app_indicator_set_icon(GlobalAppIndicator, PChar(FIconName));
  end;
  { It seems to me you can only set the menu once for an AppIndicator }
  if (app_indicator_get_menu(GlobalAppIndicator) = nil) and (FTrayIcon.PopUpMenu <> nil) then
    app_indicator_set_menu(GlobalAppIndicator, PGtkMenu(FTrayIcon.PopUpMenu.Handle));
  app_indicator_set_status(GlobalAppIndicator, APP_INDICATOR_STATUS_ACTIVE);
end;

{ TUnityWSCustomTrayIcon }

class function TUnityWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
var
  T: TUnityTrayIconHandle;
begin
  if ATrayIcon.Handle <> 0 then
  begin
    T := TUnityTrayIconHandle(ATrayIcon.Handle);
    ATrayIcon.Handle := 0;
    T.Free;
  end;
  Result := True;
end;

class function TUnityWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean;
var
  T: TUnityTrayIconHandle;
begin
  if ATrayIcon.Handle = 0 then
  begin
    T := TUnityTrayIconHandle.Create(ATrayIcon);
    ATrayIcon.Handle := HWND(T);
  end;
  Result := True;
end;

class procedure TUnityWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon);
var
  T: TUnityTrayIconHandle;
begin
  if ATrayIcon.Handle <> 0 then
  begin
    T := TUnityTrayIconHandle(ATrayIcon.Handle);
    T.Update;
  end;
end;

class function TUnityWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
begin
  Result := Point(0, 0);
end;

{ UnityAppIndicatorInit }

var
  Loaded: Boolean;
  Initialized: Boolean;

function UnityAppIndicatorInit: Boolean;
var
  Module: HModule;

  function TryLoad(const ProcName: string; var Proc: Pointer): Boolean;
  begin
    Proc := GetProcAddress(Module, ProcName);
    Result := Proc <> nil;
  end;

var
  S: string;
begin
  Result := False;
  if Loaded then
    Exit(Initialized);
  Loaded:= True;
  Module := LoadLibrary(libappindicator);
  if Module = 0 then
    Exit;
  Result :=
    TryLoad('app_indicator_get_type', @app_indicator_get_type) and
    TryLoad('app_indicator_new', @app_indicator_new) and
    TryLoad('app_indicator_new_with_path', @app_indicator_new_with_path) and
    TryLoad('app_indicator_set_status', @app_indicator_set_status) and
    TryLoad('app_indicator_set_attention_icon', @app_indicator_set_attention_icon) and
    TryLoad('app_indicator_set_menu', @app_indicator_set_menu) and
    TryLoad('app_indicator_set_icon', @app_indicator_set_icon) and
    TryLoad('app_indicator_set_label', @app_indicator_set_label) and
    TryLoad('app_indicator_set_icon_theme_path', @app_indicator_set_icon_theme_path) and
    TryLoad('app_indicator_set_ordering_index', @app_indicator_set_ordering_index) and
    TryLoad('app_indicator_get_id', @app_indicator_get_id) and
    TryLoad('app_indicator_get_category', @app_indicator_get_category) and
    TryLoad('app_indicator_get_status', @app_indicator_get_status) and
    TryLoad('app_indicator_get_icon', @app_indicator_get_icon) and
    TryLoad('app_indicator_get_icon_theme_path', @app_indicator_get_icon_theme_path) and
    TryLoad('app_indicator_get_attention_icon', @app_indicator_get_attention_icon) and
    TryLoad('app_indicator_get_menu', @app_indicator_get_menu) and
    TryLoad('app_indicator_get_label', @app_indicator_get_label) and
    TryLoad('app_indicator_get_label_guide', @app_indicator_get_label_guide) and
    TryLoad('app_indicator_get_ordering_index', @app_indicator_get_ordering_index);
  Initialized := Result;
end;

initialization
  GlobalAppIndicator := nil;
  GlobalIconPath := '';
finalization
  if FileExists(GlobalIconPath) then
    DeleteFile(GlobalIconPath);
  if GlobalAppIndicator <> nil then
    g_object_unref(GlobalAppIndicator);
end.
unitywsctrls.pas (10,618 bytes)   

Juha Manninen

2016-02-09 22:32

developer   ~0089900

UnityWSCtrls does not compile here because it misses unit dynlibs in uses section.
I can add it easily, I am just curious how you could compile it.

Anthony Walter

2016-02-10 00:10

reporter   ~0089902

It would seem someone added the dynamic library routines to the System unit. I'm unsure when this happened.

Juha Manninen

2016-02-10 08:46

developer   ~0089914

I tested with FPC 3.0, I guess you have FPC trunk.
I think dynlibs unit can safely be used with all supported compiler versions.
Committing the changes soon...

Juha Manninen

2016-02-10 12:53

developer   ~0089925

Applied, thanks.
Everybody please test with Ubuntu + Unity.

Juha Manninen

2016-02-11 19:06

developer   ~0089959

Anthony, could you please look at the related issue 0029638.

Robert Rosendahl

2016-06-14 22:00

reporter   ~0093200

I tested this with Ubuntu 14.04 LTS. The tray icon is not working on my system, probably because i do not have libappindicator.so.1, but rather libappindicator3.so.1. So it seems that in my Ubuntu 14.04 LTS a newer version of libappindicator is being distributed.

Could we change the code so that it detects libappindicator3.so.1, too, or are the two versions too different?

I could add libappindicator as a requirement for my app when building a .deb file for distribution, but that would also mean that i would require the lib on non-unity systems...

Juha Manninen

2016-06-15 09:46

developer   ~0093206

Please reopen this issue and provide a patch if you can fix it.

Robert Rosendahl

2016-06-15 11:23

reporter   ~0093208

Hm, i tried to, but i'm not able to fix that. Apparently the libappindicator3 library is not a newer version, but rather a version for gtk3, so i guess it wouldn't make sense to try and load it in a gtk2 app, anyway.

You might want to remind the lazarus gtk3 widgetset developers to integrate the unitywsctrls in lcl/interfaces/gtk3, too, though. I've taken a look, but the tray icon doesn't seem to be ported, yet, so i wasn't able to try whether that would be working (i don't have any experience with the lazarus/lcl internals...).

Issue History

Date Modified Username Field Change
2016-02-06 08:37 Anthony Walter New Issue
2016-02-06 08:37 Anthony Walter File Added: unitytray.patch
2016-02-06 08:38 Anthony Walter File Added: unitywsctrls.pas
2016-02-06 08:38 Anthony Walter Tag Attached: Ubuntu
2016-02-06 08:39 Anthony Walter Tag Attached: TTrayIcon
2016-02-06 09:12 Juha Manninen Relationship added related to 0019304
2016-02-06 09:12 Juha Manninen Relationship added related to 0023712
2016-02-09 20:32 Juha Manninen Assigned To => Juha Manninen
2016-02-09 20:32 Juha Manninen Status new => assigned
2016-02-09 22:32 Juha Manninen LazTarget => -
2016-02-09 22:32 Juha Manninen Note Added: 0089900
2016-02-09 22:32 Juha Manninen Status assigned => feedback
2016-02-10 00:10 Anthony Walter Note Added: 0089902
2016-02-10 00:10 Anthony Walter Status feedback => assigned
2016-02-10 08:46 Juha Manninen Note Added: 0089914
2016-02-10 12:53 Juha Manninen Fixed in Revision => r51555, r51565
2016-02-10 12:53 Juha Manninen Note Added: 0089925
2016-02-10 12:53 Juha Manninen Status assigned => resolved
2016-02-10 12:53 Juha Manninen Resolution open => fixed
2016-02-11 01:19 Anthony Walter Status resolved => closed
2016-02-11 19:04 Juha Manninen Relationship added related to 0029638
2016-02-11 19:06 Juha Manninen Note Added: 0089959
2016-02-11 19:06 Juha Manninen Status closed => assigned
2016-02-11 19:06 Juha Manninen Resolution fixed => reopened
2016-02-12 18:27 Juha Manninen Fixed in Revision r51555, r51565 => r51555, r51565, r51600
2016-02-12 18:27 Juha Manninen Status assigned => resolved
2016-02-12 18:27 Juha Manninen Resolution reopened => fixed
2016-06-14 22:00 Robert Rosendahl Note Added: 0093200
2016-06-15 09:46 Juha Manninen Note Added: 0093206
2016-06-15 11:23 Robert Rosendahl Note Added: 0093208