fix crashing bug when using GNOME desktop environment.
reported by obache AT netbsd DOT org, thanks.