PB v6.10 B6 - Systray Icon not visible

Post bugreports for the Linux version here
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

Systray Icon not visible

Code: Example SysTray.pb
OS: Mint Linux LMDE 6 (x86 and x64)
OS: Raspberry Linux 12 (x64)
OS: Linux vm-debian-64 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

----

The AppIndicator requires a path to the icon.
How is this realised so that this path and the icon file exist?
My example works under Mint Linux LMDE 6.
With Raspberry Linux 12 only the menu works and the icon is not displayed there. With Linux 11, the background icon is not displayed correctly.

Link: Linux AppIndicator
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

PB SysTray and my AppIndicator not work with ...

Linux Kernel Version:
* RunProgram: uname -a
- Linux vm-debian-64 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Hostname Control;
* RunProgram: hostnamectl
- Static hostname: vm-debian-64
- Icon name: computer-vm
- Chassis: vm 🖴
- Machine ID: ***
- Boot ID: ***
- Virtualization: parallels
- Operating System: Debian GNU/Linux 12 (bookworm)
- Kernel: Linux 6.1.0-18-amd64
- Architecture: x86-64
- Hardware Vendor: Parallels Software International Inc.
- Hardware Model: Parallels Virtual Platform
- Firmware Version: 19.2.1 (54832)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

1. ChangeSystrayIcon does not work yet :(

2. Since the libappindicator3 does not support a mouse click, it is probably not supported with the PB SysTray ?!

3. Since the libappindicator3 needs a path to the icon, where does PB store the icon? (gdk_pixbuf_savev)

4. libappindicator is not supported by all desktop environments.
- Supported by Mate, Ubuntu, Mint Linux, xfce, gnome, LXDE bullseye (linux 11)
- but not by debian desktop and LXDE bookworm (linux 12)

Note:
Under Mint Linux LMDE 6 and Ubuntu 22.04 the SysTray (AppIndicator) is only visible when a menu is assigned.

Code: Select all

;-TOP

UsePNGImageDecoder()

Procedure UpdateWindow()
  Protected dx, dy
  dx = WindowWidth(0)
  dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
  ; Resize Gadgets
EndProcedure

Procedure Main()
  Protected dx, dy
  Protected theme_icon_path.s, icon1, icon2
  
  theme_icon_path = #PB_Compiler_Home + "examples/sources/Data/ToolBar/"
  icon1 = LoadImage(0, theme_icon_path + "Properties.png")
  icon2 = LoadImage(1, theme_icon_path + "Delete.png")
  
  #WinStyle = #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget
  
  If OpenWindow(0, #PB_Ignore, #PB_Ignore, 300, 200, "Test Window", #WinStyle)
    ; MenuBar
    CreateMenu(0, WindowID(0))
    MenuTitle("File")
    
    CreatePopupMenu(1)
    MenuItem(1, "Active")
    MenuItem(2, "Attention")
    MenuBar()
    MenuItem(99, "Exit")
    
    ; StatusBar
    CreateStatusBar(0, WindowID(0))
    AddStatusBarField(#PB_Ignore)
    
    ; Systray
    AddSysTrayIcon(1, WindowID(0), icon1)
    SysTrayIconToolTip(1, "Icon 1")
    SysTrayIconMenu(1, MenuID(1))
    
    ; Gadgets
    dx = WindowWidth(0)
    dy = WindowHeight(0) - StatusBarHeight(0) - MenuHeight()
    
    ; Bind Events
    BindEvent(#PB_Event_SizeWindow, @UpdateWindow(), 0)
    
    ; Main Loop
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Select EventWindow()
            Case 0
              Break
          EndSelect
          
        Case #PB_Event_Menu
          Select EventMenu()
            Case 1
              ChangeSysTrayIcon(1, icon1)
            Case 2
              ChangeSysTrayIcon(1, icon2)
            Case 99
              Break
          EndSelect 
          
        Case #PB_Event_SysTray
          Select EventType()
            Case #PB_EventType_LeftClick
              Debug "Systray Leftclick"
          EndSelect
          
        Case #PB_Event_Gadget
          Select EventGadget()
              
          EndSelect
          
      EndSelect
    ForEver
    
  EndIf
  
EndProcedure : Main()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

Raspberry BookWorm

The icon is visible with X11 but not with Wayland :cry:
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 16661
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB v6.10 B6 - Systray Icon not visible

Post by Fred »

I fixed the ChangeSystrayIcon issue. We use the /tmp folder to write the temporary imageID to disk as it indeed need a filename (image is deleted once the process is closed or RemoveSystrayIcon() is called). About Raspberry, it seems that wayland has needs some tweak to have it working: https://www.raspberrypi.com/news/bookwo ... rry-pi-os/ (didn't found a solution as well). Debian 12 switched to libayatana-appindicator instead of the ubuntu one, so I added this to the dynamic lib loading, but it didn't solved the issue.

edit: just found a way for debian 12, might work for Raspberry as well:
You can go there with firefox and click install:
https://extensions.gnome.org/extension/ ... tsfoss.com

info found here: https://itsfoss.com/enable-applet-indicator-gnome/
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

Hello Fred,

I've already reached that point.
I installed the gnome-shell-extension-appindicator with a new system.

Attention! Use sudo pcmanfm to backup the folder "/etc/xdg/autostart" to "/etc/xdg/autostart.org" for restore
sudo apt-get install gnome-shell-extension-appindicator
Attention! Best not to try, otherwise reinstall system

These also only work under X11 and not under Wayland!

With sudo tasksel you can also install another desktop environment where it will work. (What I do not want)

So it is because of the LXDE Wayland. With LXDE X11 it works (like xscreensaver)

Recommendation from me:
Switch to X11 and wait until the LXDE Wayland works with libappindicator3.

P.S.
Is a bug with LXPanel Wayland, only the icon is not displayed but the menu is opened

P.S.2
System reinstalled and set up after about 35 minutes with all software.
I have already practiced ;)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

The documentation of the Systray must also include the note that mouse clicks are not supported
as the libappindicator does not give a signal for this.
A SysTrayID() would be nice to get to the appindicator

Thank you Fred for the new SysTray (libappindicator) as the previous functions for this have been removed from GTK3.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5380
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PB v6.10 B6 - Systray Icon not visible

Post by mk-soft »

Raspberry LXDE:

Sometimes when starting the program.

Systray2.pb
[21:02:03] Waiting for executable to start...
[21:02:03] Executable type: Linux - arm64 (64bit, Unicode)
[21:02:03] Executable started.
[21:02:07] The Program execution has finished.
[21:02:10] Waiting for executable to start...
[21:02:09] Executable type: Linux - arm64 (64bit, Unicode)
[21:02:10] Executable started.
[21:02:10] [WARNING] Systray2.pb (Line: 177)
[21:02:10] [WARNING] Gdk (CRITICAL): gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply