Kaydet (Commit) c80d34ad authored tarafından Caolán McNamara's avatar Caolán McNamara

gtk3: use window groups so modal dialog are modal to their toplevel frame only

so e.g. launching help from a modal dialog gives a new toplevel window
which is not blocked by the modal dialog on the other window.

likesize can go from one blocked e.g. writer window to calc and type away in
there happily

Change-Id: Id9376b393514e91dfd667dfce132f1f37367084e
üst 44819f98
...@@ -796,8 +796,10 @@ GtkSalFrame::~GtkSalFrame() ...@@ -796,8 +796,10 @@ GtkSalFrame::~GtkSalFrame()
InvalidateGraphics(); InvalidateGraphics();
if( m_pParent ) if (m_pParent)
{
m_pParent->m_aChildren.remove( this ); m_pParent->m_aChildren.remove( this );
}
getDisplay()->deregisterFrame( this ); getDisplay()->deregisterFrame( this );
...@@ -1196,6 +1198,12 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle ) ...@@ -1196,6 +1198,12 @@ void GtkSalFrame::Init( SalFrame* pParent, SalFrameStyleFlags nStyle )
if (!(m_pParent->m_nStyle & SalFrameStyleFlags::PLUG)) if (!(m_pParent->m_nStyle & SalFrameStyleFlags::PLUG))
gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) );
m_pParent->m_aChildren.push_back( this ); m_pParent->m_aChildren.push_back( this );
gtk_window_group_add_window(gtk_window_get_group(GTK_WINDOW(m_pParent->m_pWindow)), GTK_WINDOW(m_pWindow));
}
else
{
gtk_window_group_add_window(gtk_window_group_new(), GTK_WINDOW(m_pWindow));
g_object_unref(gtk_window_get_group(GTK_WINDOW(m_pWindow)));
} }
// set window type // set window type
...@@ -2343,11 +2351,17 @@ const SystemEnvData* GtkSalFrame::GetSystemData() const ...@@ -2343,11 +2351,17 @@ const SystemEnvData* GtkSalFrame::GetSystemData() const
void GtkSalFrame::SetParent( SalFrame* pNewParent ) void GtkSalFrame::SetParent( SalFrame* pNewParent )
{ {
if( m_pParent ) if (m_pParent)
m_pParent->m_aChildren.remove( this ); {
gtk_window_group_remove_window(gtk_window_get_group(GTK_WINDOW(m_pParent->m_pWindow)), GTK_WINDOW(m_pWindow));
m_pParent->m_aChildren.remove(this);
}
m_pParent = static_cast<GtkSalFrame*>(pNewParent); m_pParent = static_cast<GtkSalFrame*>(pNewParent);
if( m_pParent ) if (m_pParent)
m_pParent->m_aChildren.push_back( this ); {
m_pParent->m_aChildren.push_back(this);
gtk_window_group_add_window(gtk_window_get_group(GTK_WINDOW(m_pParent->m_pWindow)), GTK_WINDOW(m_pWindow));
}
if( ! isChild() ) if( ! isChild() )
gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), gtk_window_set_transient_for( GTK_WINDOW(m_pWindow),
(m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : nullptr (m_pParent && ! m_pParent->isChild(true,false)) ? GTK_WINDOW(m_pParent->m_pWindow) : nullptr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment