From 7e41ac405f4105a7703e37bffd8ab951159f5af0 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 25 May 2016 09:39:50 -0700 Subject: [PATCH] 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 --- src/gtk/menu.cpp | 7 ++++++- src/gtk/toolbar.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 7a5d008ab1..5331c7540f 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -120,7 +120,12 @@ void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long st 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(); gtk_container_add(GTK_CONTAINER(m_widget), m_menubar); diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index ff5bcdefa4..64a7c70c06 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -386,7 +386,12 @@ bool wxToolBar::Create( wxWindow *parent, #endif 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();