+bool wxWindowGTK::IsTransparentBackgroundSupported(wxString* reason) const
+{
+#if wxGTK_HAS_COMPOSITING_SUPPORT
+ if (gtk_check_version(wxGTK_VERSION_REQUIRED_FOR_COMPOSITING) != NULL)
+ {
+ if (reason)
+ {
+ *reason = _("GTK+ installed on this machine is too old to "
+ "support screen compositing, please install "
+ "GTK+ 2.12 or later.");
+ }
+
+ return false;
+ }
+
+ // NB: We don't check here if the particular kind of widget supports
+ // transparency, we check only if it would be possible for a generic window
+
+ wxCHECK_MSG ( m_widget, false, "Window must be created first" );
+
+ if (!gdk_screen_is_composited(gtk_widget_get_screen(m_widget)))
+ {
+ if (reason)
+ {
+ *reason = _("Compositing not supported by this system, "
+ "please enable it in your Window Manager.");
+ }
+
+ return false;
+ }
+
+ return true;
+#else
+ if (reason)
+ {
+ *reason = _("This program was compiled with a too old version of GTK+, "
+ "please rebuild with GTK+ 2.12 or newer.");
+ }
+
+ return false;
+#endif // wxGTK_HAS_COMPOSITING_SUPPORT/!wxGTK_HAS_COMPOSITING_SUPPORT
+}
+