From 40cbd1603a995afb9cf9cfdc2741f8b9d1bba13b Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 9 Oct 2013 18:07:31 +0000 Subject: [PATCH] Window decoration fixes for Wayland. Allow setting no decorations, and an attempt to allow setting no title bar. closes #15553 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/minifram.cpp | 1 + src/gtk/toplevel.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp index 6d07a6d893..24c32acaa6 100644 --- a/src/gtk/minifram.cpp +++ b/src/gtk/minifram.cpp @@ -392,6 +392,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title gtk_container_add(GTK_CONTAINER(m_widget), eventbox); m_gdkDecor = 0; + gtk_window_set_decorated(GTK_WINDOW(m_widget), false); m_gdkFunc = 0; if (style & wxRESIZE_BORDER) m_gdkFunc = GDK_FUNC_RESIZE; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 8752f0805a..d91936b4e8 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -720,6 +720,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, if ( (style & wxSIMPLE_BORDER) || (style & wxNO_BORDER) ) { m_gdkDecor = 0; + gtk_window_set_decorated(GTK_WINDOW(m_widget), false); } else // have border { @@ -727,6 +728,14 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, if ( style & wxCAPTION ) m_gdkDecor |= GDK_DECOR_TITLE; +#if defined(GDK_WINDOWING_WAYLAND) && GTK_CHECK_VERSION(3,10,0) + else if ( + GDK_IS_WAYLAND_SCREEN(gtk_window_get_screen(GTK_WINDOW(m_widget))) && + gtk_check_version(3,10,0) == NULL) + { + gtk_window_set_titlebar(GTK_WINDOW(m_widget), gtk_header_bar_new()); + } +#endif if ( style & wxSYSTEM_MENU ) m_gdkDecor |= GDK_DECOR_MENU;