Fwiw, last change will likely need to be split, a lot, I only had a quick look but I can't review the whole code at once. Start by creating the D-Bus thread, then progressively add owner requests and interface checks, then implementing icon requests, etc... Balloon support can probably be implemented last.