> minimized = (event.active.gain == 0) ? 1 : 0; No. On X11, you lose that flag when leaving the window. On MacOSX, you lose that flag when the window loses keyboard focus. Neither represent whether the window is minimized. --ryan.