- if (GetParent() && GetParent()->GetMainWindow())
- {
- Window xparentwindow = (Window) GetParent()->GetMainWindow();
- XSetTransientForHint( xdisplay, xwindow, xparentwindow );
+ Window xroot = RootWindow( xdisplay, xscreen );
+ XSetTransientForHint( xdisplay, xwindow, xroot );
+ }
+ else
+ {
+ if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
+ {
+ if (GetParent() && GetParent()->GetMainWindow())
+ {
+ Window xparentwindow = (Window) GetParent()->GetMainWindow();
+ XSetTransientForHint( xdisplay, xwindow, xparentwindow );
+ }