Patch originally from https://github.com/lxde/lxpanel/commit/0853b0fc981285ebd2ac52f8dfc2a09b1090748c