create wxDialog with proper _NET_WM hint so that the WMs recognize it as a dialog

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-06-28 21:37:33 +00:00
parent 79e55c661b
commit 4d8d6490da
2 changed files with 24 additions and 12 deletions

View File

@@ -350,21 +350,27 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
if (m_widget == NULL) if (m_widget == NULL)
{ {
GtkWindowType win_type = GTK_WINDOW_TOPLEVEL; GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
if (style & wxFRAME_TOOL_WINDOW) if (style & wxFRAME_TOOL_WINDOW)
win_type = GTK_WINDOW_POPUP; win_type = GTK_WINDOW_POPUP;
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{ {
// there is no more GTK_WINDOW_DIALOG in 2.0
#ifdef __WXGTK20__ #ifdef __WXGTK20__
win_type = GTK_WINDOW_TOPLEVEL; m_widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// Tell WM that this is a dialog window and make it center
// on parent by default (this is what GtkDialog ctor does):
gtk_window_set_type_hint(GTK_WINDOW(m_widget),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_position(GTK_WINDOW(m_widget),
GTK_WIN_POS_CENTER_ON_PARENT);
#else #else
win_type = GTK_WINDOW_DIALOG; m_widget = gtk_window_new(GTK_WINDOW_DIALOG);
#endif #endif
} }
else
m_widget = gtk_window_new( win_type ); {
m_widget = gtk_window_new(win_type);
}
} }
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) && if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&

View File

@@ -350,21 +350,27 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
if (m_widget == NULL) if (m_widget == NULL)
{ {
GtkWindowType win_type = GTK_WINDOW_TOPLEVEL; GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
if (style & wxFRAME_TOOL_WINDOW) if (style & wxFRAME_TOOL_WINDOW)
win_type = GTK_WINDOW_POPUP; win_type = GTK_WINDOW_POPUP;
if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) if (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)
{ {
// there is no more GTK_WINDOW_DIALOG in 2.0
#ifdef __WXGTK20__ #ifdef __WXGTK20__
win_type = GTK_WINDOW_TOPLEVEL; m_widget = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// Tell WM that this is a dialog window and make it center
// on parent by default (this is what GtkDialog ctor does):
gtk_window_set_type_hint(GTK_WINDOW(m_widget),
GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_position(GTK_WINDOW(m_widget),
GTK_WIN_POS_CENTER_ON_PARENT);
#else #else
win_type = GTK_WINDOW_DIALOG; m_widget = gtk_window_new(GTK_WINDOW_DIALOG);
#endif #endif
} }
else
m_widget = gtk_window_new( win_type ); {
m_widget = gtk_window_new(win_type);
}
} }
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) && if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&