Made the hide code gtk2/3 compatible