Try to modify the type hint of your dialog:
void gtk_window_set_type_hint (GtkWindow *window,
By setting the type hint for the window, you allow the window manager to decorate and handle the window in a way which is suitable to the function of the window in your application.
This function should be called before the window becomes visible.
gtk_dialog_new_with_buttons() and other convenience functions in GTK+ will sometimes call gtk_window_set_type_hint() on your behalf.
I use as hint:
but I beleive that's a mistake and I (you) should use
Also did you put your main windows as modal? or your dialog as modal
If your main windows is modal, I guess it migth be the problem and you should remove the modal (at least during the life time of your dialog window)