Functionality had to be moved to a separate source file due to namespace pollution from X11 headers. Note that this doesn't set proper parent of file dialogs on Linux, as GTK is broken and requires passing a GtkWindow parent.