[Gambas-user] Help SystemTray gb-qt5 64 bits

herberth guzman herberthguzman at gmail.com
Wed Apr 1 21:24:56 CEST 2020


El mié., 1 abr. 2020 a las 13:23, herberth guzman (<herberthguzman at gmail.com>)
escribió:

> New Systray
> Fabien helped me with this example
> but I'm still in trouble.
>
> Private $hTrayIcons As New TrayIcon[]
>
> Public Sub Form_Open()
>
>   Dim a As String[]
>   Dim s As String
>   Dim sIcon As String
>   Dim hTray As TrayIcon
>   Dim vIconPixmap As Variant
>   Dim i As Integer
>   Dim ii As Integer
>   Dim hbut As New Button(Me)
>   DBus.Debug = True
>
>    a = DBus["org.kde.StatusNotifierWatcher"]["/StatusNotifierWatcher",
> "org.kde.StatusNotifierWatcher"].RegisteredStatusNotifierItems
>
>   For Each s In a
>
>     'sIcon = DBus[File.Dir(s)]["/" & File.Name(s),
> "org.kde.StatusNotifierItem"].IconThemePath
>     hTray = New TrayIcon
>     hTray.Name = s
>     hbut.Text = s
>     'Print DBus[File.Dir(s)]["/" & File.Name(s),
> "org.kde.StatusNotifierItem"].OverlayIconName
>     sIcon = DBus[File.Dir(s)]["/" & File.Name(s),
> "org.kde.StatusNotifierItem"].IconName
>     hTray.IconName = sIcon
>
> '    Print sIcon
> '    Print hTray.IconName
>     vIconPixmap = DBus[File.Dir(s)]["/" & File.Name(s),
> "org.kde.StatusNotifierItem"].IconPixmap
>     If vIconPixmap Then
>       Try hTray.Icon = GetPictureFromAVariant(vIconPixmap)
>     Endif
>
>     $hTrayIcons.Add(hTray)
>
>      For ii = 0 To $hTrayIcons.Max
>        hbut.H = 48
>      hbut.w = 48
>      hbut.Picture = $hTrayIcons[i].GetIcon(32)
>
>      Next
> '    Paint.DrawPicture($hTrayIcons[i].GetIcon(32), i * 32, 5)
>
>
>   Next
>
>   DrawingArea1.Refresh
>
>   'Me.Picture = hDBusPixmap.GetPicture()
> End
>
> Private Sub GetPictureFromAVariant(hValue As Variant[]) As Picture
>
>   Dim H, W As Integer
>   Dim hData As Byte[]
>   Dim hFile As File
>   Dim hPic As Image
>
>   W = hValue[0][0]
>   H = hValue[0][1]
>   hData = hValue[0][2]
>
>   hPic = New Image(W, H, Color.Transparent)
>   hPic.Format = "ARGB"
>   hFile = Memory hPic.Data For Write
>   hData.Write(hFile)
>   hFile.Close
>   Return hPic.picture
>
> End
>
> Public Sub DrawingArea1_Draw()
>
>   Dim i As Integer
>
>   For i = 0 To $hTrayIcons.Max
>     Paint.DrawPicture($hTrayIcons[i].GetIcon(32), i * 32, 5)
>   Next
>
> End
>
> [System]
> Gambas=3.14.90 0714bf7 (master)
> OperatingSystem=Linux
> Kernel=5.4.0-18-generic
> Architecture=x86_64
> Distribution=Ubuntu Focal Fossa (development branch)
> Desktop=INNOVA
> Theme=Fusion
> Language=es_GT.UTF-8
> Memory=3735M
>
> [Libraries]
> Cairo=libcairo.so.2.11600.0
> Curl=libcurl.so.4.6.0
> DBus=libdbus-1.so.3.19.11
> GStreamer=libgstreamer-1.0.so.0.1602.0
> GTK+2=libgtk-x11-2.0.so.0.2400.32
> GTK+3=libgtk-3.so.0.2404.10
> OpenGL=libGL.so.1.7.0
> Poppler=libpoppler.so.95.0.0
> Poppler=libpoppler.so.97.0.0
> QT5=libQt5Core.so.5.12.5
> SDL=libSDL-1.2.so.0.11.4
> SQLite=libsqlite3.so.0.8.6
>
> [Environment]
> CLUTTER_IM_MODULE=ibus
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
> DESKTOP_SESSION=Innova
> DISPLAY=:0
> GB_GUI=gb.qt5
> GDMSESSION=Innova
> GNOME_DESKTOP_SESSION_ID=this-is-deprecated
> GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
> GTK_IM_MODULE=ibus
> GTK_MODULES=gail:atk-bridge
> HOME=<home>
> LANG=es_GT.UTF-8
> LANGUAGE=es_GT.UTF-8
> LOGNAME=<user>
>
> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
> PWD=<home>
> QT4_IM_MODULE=ibus
> QT_ACCESSIBILITY=1
> QT_IM_MODULE=ibus
> QT_LOGGING_RULES=*.debug=false
>
> SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/1740,unix/<hostname>:/tmp/.ICE-unix/1740
> SHELL=/bin/bash
> SHLVL=1
> SSH_AGENT_PID=1692
> SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
> TZ=:/etc/localtime
> USER=<user>
> USERNAME=<user>
> WINDOWPATH=2
> XAUTHORITY=/run/user/1000/gdm/Xauthority
> XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg/xdg-Innova:/etc/xdg
> XDG_CONFIG_HOME=<home>/.config
> XDG_CURRENT_DESKTOP=Innova
>
> XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/:/var/lib/menu-xdg/
> XDG_MENU_PREFIX=innova-
> XDG_RUNTIME_DIR=/run/user/1000
> XDG_SEAT=seat0
> XDG_SESSION_CLASS=user
> XDG_SESSION_DESKTOP=Innova
> XDG_SESSION_ID=10
> XDG_SESSION_TYPE=x11
> XDG_VTNR=2
> XMODIFIERS=@im=ibus
>
> El mié., 1 abr. 2020 a las 13:21, herberth guzman (<
> herberthguzman at gmail.com>) escribió:
>
>> X11 Classic
>> gb-qt5 BAD
>> gb-qt4 OK
>>
>> Public Sub _new()
>>
>> Shell "vlc"
>> Shell "nm-applet"
>>
>> End
>>
>> Public Sub Form_Open()
>>
>>   X11Systray.Show(dwgSystemTray.Handle)
>>
>> End
>>
>> Static Public Sub X11Systray_Arrange()
>>
>>   FMain.ArrangeTray
>>
>> End
>>
>> Public Sub ArrangeTray()
>>
>>   Dim I As Integer
>>   Dim X, Y, H As Integer
>>
>>   Debug
>>   X = 2
>>   Y = 2
>>   For I = 0 To X11Systray.Count - 1
>>     With X11Systray[I]
>>       Debug I;; .IconW;; .IconH
>>       If (X + .IconW) >= (Me.ClientW - 2) Then
>>         X = 2
>>         Y += H + 2
>>         H = 0
>>       Endif
>>       .Move(X, Y, .IconW, .IconH)
>>       H = Max(H, .IconH)
>>       X += .IconW + 2
>>     End With
>>   Next
>>
>> End
>>
>> Public Sub Form_Resize()
>>
>>   ArrangeTray
>>
>> End
>>
>>
>>
>>
>>
>>
>> El mié., 1 abr. 2020 a las 13:13, Benoît Minisini (<g4mba5 at gmail.com>)
>> escribió:
>>
>>> Le 01/04/2020 à 21:05, herberth guzman a écrit :
>>> >
>>> >>>What does not work exactly?
>>> >
>>> > I have a classic system tray (x11)
>>> > with ubuntu 32 bits and gb-qt4 it works fine for me
>>> >
>>> > with ubuntu 64 bit and gb-qt5 it doesn't work
>>> > does not show anything in the system tray
>>> >
>>> > Error:
>>> > qt.qpa.xcb: Unhandled client message: "_NET_WM_DESKTOP"
>>> > FMain.ArrangeTray.28:
>>> >
>>>
>>> If you don't give more details, I can't help. Which system? Which
>>> desktop? How do you implement the system tray? Did you implement X11
>>> protocol, DBus protocol, both? And so on...
>>>
>>> --
>>> Benoît Minisini
>>>
>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200401/03482ea5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NotificationArea-0.0.2.tar.gz
Type: application/gzip
Size: 12586 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200401/03482ea5/attachment-0002.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SystemTray-1.0.tar.gz
Type: application/gzip
Size: 24223 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200401/03482ea5/attachment-0003.gz>


More information about the User mailing list