[BUG] Tint2 rare crash

The tint2 panel crashes when using certain applications, such as Remote Desktop Manager or Steam client.
More information is needed…

For now, I’m working on a workaround.

1 Like

Great.

In my case the tint2 bar has been the same -and no crashes- for years. I do use RDP (xfreerdp3) but from console only. Crashes are random and scarce but only a couple of months ago. :thinking:

1 Like

I will try to write a toggle, as we already have for Conky W-c and for Picom W-p.
It won’t fix tint2 bug, but at last make life a little bit easier :wink:

Script like this may work…

#!/bin/bash

# tint2_toggle

if pgrep -afu $USER "tint2 -c " 2>/dev/null; then
    killall -u $USER tint2
else
    mb-tint2-session
fi

I will test it and probably publish with mabox-tools update later today.

Tint2 can be enabled or disabled from the Windows & Desktops menu, which you open with W-A-d or by clicking on the desktop while holding the Super key.

Hi @napcok and users facing the tint2 issue

I debugged the tint2 systray SEGFAULT issue that users reported. The crash occurred when:

  • RemoteDesktopManager embeds a 1×1 pixel systray icon
  • Moving windows between workspaces on multi-monitor setups
  • Steam adds systray icons to the panel

The root cause was in src/systray/systraybar.c:

Two critical bugs:

  1. Missing pointer validation in on_change_systray()

    • traywin pointer was dereferenced without NULL checks
    • Window handle validity was not verified
    • Pathological 1×1 pixel icons caused integer overflow in layout calculations
  2. XGetGeometry failure handling

    • When window geometry retrieval failed (common on secondary monitors), the code used uninitialized variables
    • This led to memory corruption when repositioning icons
    • Especially triggered when moving windows between workspaces

The fix:

  • Added NULL pointer validation before dereferencing traywin
  • Added window handle validation (win == None)
  • Added graceful error handling for failed XGetGeometry calls (skip problematic icons)
  • Enforced minimum icon_size bounds

What’s now fixed:

  • RemoteDesktopManager no longer crashes tint2
  • Steam systray no longer crashes tint2
  • Moving windows between workspaces is safe
  • Multi-monitor setups work reliably

Testing

This is a fork for community testing:

# First uninstall tint2
sudo pacman -R tint2

# clone git + install package
git clone https://gitlab.com/muzlabz/tint2.git
cd tint2
sudo makepkg -si

# Check package info
yay -Qi tint2

# Check install path
which tint2

# To be sure: Reboot system.
reboot system


Please test and report back with output logs!

1 Like

Very interesting… but:

15:13 $ sudo makepkg -i
==> ERROR: Running makepkg as root is not allowed as it can cause permanent,
catastrophic damage to your system.
✔ ~/tint2 [master|✚ 3…63] 

Running without sudo results in CMake errors.