Use appnope in qt and wx gui support from the terminal

Apply #6189 to master

I merged #6189 before realizing that it was made against the wrong branch.