Avoid blank menubar/toolbar when using wx[MT]B_DOCKABLE with GTK+ 3.20

A GTK+ bug involving GtkHandleBox somehow prevents drawing of its child
since 3.19.7.  Avoid this by disabling the docking functionality, which
is preferable to having the bar be blank.
See #17539
This commit is contained in:
Paul Cornett
2016-05-25 09:39:50 -07:00
parent 9c30da08c0
commit 7e41ac405f
2 changed files with 12 additions and 2 deletions

View File

@@ -120,7 +120,12 @@ void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long st
m_menubar = gtk_menu_bar_new(); m_menubar = gtk_menu_bar_new();
if (style & wxMB_DOCKABLE) if ((style & wxMB_DOCKABLE)
#ifdef __WXGTK3__
// using GtkHandleBox prevents menubar from drawing with GTK+ >= 3.19.7
&& gtk_check_version(3,19,7)
#endif
)
{ {
m_widget = gtk_handle_box_new(); m_widget = gtk_handle_box_new();
gtk_container_add(GTK_CONTAINER(m_widget), m_menubar); gtk_container_add(GTK_CONTAINER(m_widget), m_menubar);

View File

@@ -386,7 +386,12 @@ bool wxToolBar::Create( wxWindow *parent,
#endif #endif
GtkSetStyle(); GtkSetStyle();
if (style & wxTB_DOCKABLE) if ((style & wxTB_DOCKABLE)
#ifdef __WXGTK3__
// using GtkHandleBox prevents toolbar from drawing with GTK+ >= 3.19.7
&& gtk_check_version(3,19,7)
#endif
)
{ {
m_widget = gtk_handle_box_new(); m_widget = gtk_handle_box_new();