From c46d05caf360cfb43215e15d466016728d021c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 30 Nov 2015 14:03:34 +0000 Subject: [PATCH] Resolves: rhbz#1285380 get menus working under wayland use GDK_WINDOW_TYPE_HINT_POPUP_MENU hint for menus and set hints after widget is realized and set gtk_window_set_transient_for menus too then you get menus and tooltips apparently in the right place Change-Id: Ib1046fb0872b9d8a5f80cc5f48828ef7f086b1a1 --- vcl/unx/gtk/window/gtksalframe.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 8acdf8a..0053e5b 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -1401,6 +1401,15 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) if( m_pParent && m_pParent->m_pWindow && ! isChild() ) gtk_window_set_screen( GTK_WINDOW(m_pWindow), gtk_window_get_screen( GTK_WINDOW(m_pParent->m_pWindow) ) ); + if (m_pParent) + { + if (!(m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG)) + gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); + m_pParent->m_aChildren.push_back( this ); + } + + InitCommon(); + // set window type bool bDecoHandling = ! isChild() && @@ -1441,17 +1450,11 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) #endif gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), eType ); gtk_window_set_gravity( GTK_WINDOW(m_pWindow), GDK_GRAVITY_STATIC ); - if( m_pParent && ! (m_pParent->m_nStyle & SAL_FRAME_STYLE_PLUG) ) - gtk_window_set_transient_for( GTK_WINDOW(m_pWindow), GTK_WINDOW(m_pParent->m_pWindow) ); } else if( (nStyle & SAL_FRAME_STYLE_FLOAT) ) { - gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_UTILITY ); + gtk_window_set_type_hint( GTK_WINDOW(m_pWindow), GDK_WINDOW_TYPE_HINT_POPUP_MENU ); } - if( m_pParent ) - m_pParent->m_aChildren.push_back( this ); - - InitCommon(); #if !GTK_CHECK_VERSION(3,0,0) if( eWinType == GTK_WINDOW_TOPLEVEL ) -- 2.5.0