diff --git a/docs/changes.txt b/docs/changes.txt index 244c410e7f..b608898d23 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -109,6 +109,7 @@ wxGTK: - wxTopLevelWindow::GetClientSize() returns 0x0 when the window is minimized. - Added support for colour cursors (Pascal Monasse). - Setting foreground colour of single line wxTextCtrl now works +- Added gtk.tlw.can-set-transparency system option wxMac: diff --git a/docs/latex/wx/sysopt.tex b/docs/latex/wx/sysopt.tex index cd945711a4..12b8b11bf8 100644 --- a/docs/latex/wx/sysopt.tex +++ b/docs/latex/wx/sysopt.tex @@ -33,6 +33,19 @@ Setting this to 0 causes more flicker, but allows applications to paint graphics used.} \end{twocollist} +\wxheading{GTK} + +\twocolwidtha{7cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf Option}}{{\bf Value}} +\twocolitem{gtk.tlw.can-set-transparent}{\helpref{wxTopLevelWindow::CanSetTransparent()}{wxtoplevelwindowcansettransparent} +method normally tries to detect automatically whether transparency for top +level windows is currently supported, however this may sometimes fail and this +option allows to override the automatic detection. Setting it to $1$ makes the +transparency be always available (setting it can still fail, of course) and +setting it to $0$ makes it always unavailable.} +\end{twocollist} + \wxheading{Mac} \twocolwidtha{7cm} diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 7227e4887f..f47a53f8b8 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -33,6 +33,7 @@ #include "wx/gtk/private.h" #include "wx/evtloop.h" +#include "wx/sysopt.h" #include #include @@ -1415,6 +1416,13 @@ bool wxTopLevelWindowGTK::SetTransparent(wxByte alpha) bool wxTopLevelWindowGTK::CanSetTransparent() { + // allow to override automatic detection as it's far from perfect + static const wxChar *SYSOPT_TRANSPARENT = wxT("gtk.tlw.can-set-transparent"); + if ( wxSystemOptions::HasOption(SYSOPT_TRANSPARENT) ) + { + return wxSystemOptions::GetOptionInt(SYSOPT_TRANSPARENT) != 0; + } + #if GTK_CHECK_VERSION(2,10,0) if (!gtk_check_version(2,10,0)) {