I finaly got it to show the menus, i replaced the following:
That did the trick, i still have 2 questions though.
1) Do i need to delete the BPopUpMenu objects? if so, do i need to do it in both functions? LeftClick()/Rightclick().
2) when i compile the app with gcc5 on a hybrid system the replicant doesn't show up in the Deskbar and there is no output in the terminal, even though i set a check in the code which works when compiled with gcc2.
Here is my final Deskbar.cpp file: