87a683e
From 57dce78348cbe93d53c1432ee224e27fdd726982 Mon Sep 17 00:00:00 2001
87a683e
From: Paul Cornett <paulcor@users.noreply.github.com>
87a683e
Date: Wed, 25 May 2016 09:39:50 -0700
87a683e
Subject: [PATCH] Avoid blank menubar/toolbar when using wx[MT]B_DOCKABLE with
87a683e
 GTK+ 3.20
87a683e
87a683e
A GTK+ bug involving GtkHandleBox somehow prevents drawing of its child
87a683e
since 3.19.7.  Avoid this by disabling the docking functionality, which
87a683e
is preferable to having the bar be blank.
87a683e
See #17539
87a683e
87a683e
(cherry picked from commit 7e41ac405f4105a7703e37bffd8ab951159f5af0)
87a683e
---
87a683e
 src/gtk/menu.cpp    | 7 ++++++-
87a683e
 src/gtk/toolbar.cpp | 7 ++++++-
87a683e
 2 files changed, 12 insertions(+), 2 deletions(-)
87a683e
87a683e
diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp
87a683e
index 3c5426d..5aa3caf 100644
87a683e
--- a/src/gtk/menu.cpp
87a683e
+++ b/src/gtk/menu.cpp
87a683e
@@ -141,7 +141,12 @@ void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long st
87a683e
 
87a683e
     m_menubar = gtk_menu_bar_new();
87a683e
 
87a683e
-    if (style & wxMB_DOCKABLE)
87a683e
+    if ((style & wxMB_DOCKABLE)
87a683e
+#ifdef __WXGTK3__
87a683e
+        // using GtkHandleBox prevents menubar from drawing with GTK+ >= 3.19.7
87a683e
+        && gtk_check_version(3,19,7)
87a683e
+#endif
87a683e
+        )
87a683e
     {
87a683e
         m_widget = gtk_handle_box_new();
87a683e
         gtk_container_add(GTK_CONTAINER(m_widget), m_menubar);
87a683e
diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp
87a683e
index 9416f83..addf63a 100644
87a683e
--- a/src/gtk/toolbar.cpp
87a683e
+++ b/src/gtk/toolbar.cpp
87a683e
@@ -388,7 +388,12 @@ bool wxToolBar::Create( wxWindow *parent,
87a683e
 #endif
87a683e
     GtkSetStyle();
87a683e
 
87a683e
-    if (style & wxTB_DOCKABLE)
87a683e
+    if ((style & wxTB_DOCKABLE)
87a683e
+#ifdef __WXGTK3__
87a683e
+        // using GtkHandleBox prevents toolbar from drawing with GTK+ >= 3.19.7
87a683e
+        && gtk_check_version(3,19,7)
87a683e
+#endif
87a683e
+        )
87a683e
     {
87a683e
         m_widget = gtk_handle_box_new();
87a683e