OK, I started a new branch "promopopup" on hgm.nubati.net. In that brnch, I eliminated the promoton popup altogether. Like already was the case for Great Shatranj and SuperChess, there is no popup when you promote, but XBoard just waits until you click a piece (displaying a message in the message field that you should do so).
For the mmentioned variants, the choice was limited to what you had in your holdings, which wre always displayed. In other variants, the piece you want might not be on the board, however. So what I had to add is that it stuffs a temporary board with all the pieces you can promote to. (It gets those from the pieceToChar table.) It then displays that board, waiting for you to click it. So the whole thing is now completely handled in the back-end, so merging it with the gtk branch will make it work there without any changes! If we rather have a true popup, the board that is now displayed in the main window would need to appear as a mini-board in a popup, with a cancel button added. (If people want to cancel now, they can click an empty square.) But this is merely a cosmetic refinement now. I cannot do the same thing for the Edit Position menu entirely in the back-end, because that popup is called from the front-end to start with. I could only do it here because the mouse driver for left clicks was moved to the back-end. So my next step will be to similarly move the mouse driver for right clicks to the back-end, and then address the Edit-Position menu. (Which is then just a matter of cloning what I have done for the promotion popup, except that you decide a little differently which pieces you put in the menu.) Migrating the right-click mouse driver to the back-end will also make the PV display feature work in the gtk branch, (once the gtk front-end hooks into this). Having a real popup for this opens the interesting possibility to re-instate the drop menu, (controlled by an option), in stead of the holdings. In stead of permanently displayed holdings, the holdings could be made to apper as a popup. This would save space, which might be good in bughouse where you want to see two boards.
