Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
set transient parent for 'about' dialog, closes #16823
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
  • Loading branch information
Paul Cornett committed Feb 2, 2015
1 parent 0e6f0bd commit bb3dcf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gtk/aboutdlg.cpp
Expand Up @@ -23,7 +23,7 @@
#include "wx/aboutdlg.h"

#ifndef WX_PRECOMP
#include "wx/utils.h" // for wxLaunchDefaultBrowser()
#include "wx/window.h"
#endif //WX_PRECOMP

#include <gtk/gtk.h>
Expand Down Expand Up @@ -131,7 +131,7 @@ static void wxGtkAboutDialogOnLink(GtkAboutDialog*, const char* link, void*)
}
#endif

void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent)
{
// don't create another dialog if one is already present
if ( !gs_aboutDialog )
Expand Down Expand Up @@ -235,6 +235,11 @@ void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent))
g_signal_connect(dlg, "response",
G_CALLBACK(wxGtkAboutDialogOnClose), NULL);

GtkWindow* gtkParent = NULL;
if (parent && parent->m_widget)
gtkParent = (GtkWindow*)gtk_widget_get_ancestor(parent->m_widget, GTK_TYPE_WINDOW);
gtk_window_set_transient_for(GTK_WINDOW(dlg), gtkParent);

gtk_window_present(GTK_WINDOW(dlg));
}

Expand Down

0 comments on commit bb3dcf8

Please sign in to comment.