From 67e51e7b6df53c4bbc37afcf6c5d9c521aa09592 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 24 Oct 2018 01:37:44 +0200 Subject: [PATCH] Show the reason transparent windows can't be used in shaped sample IsTransparentBackgroundSupported() may return more information about why exactly are transparent windows not supported, show it if available. --- samples/shaped/shaped.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index 9b4985b223..25c6b6e83c 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -278,14 +278,17 @@ void MainFrame::OnShowShaped(wxCommandEvent& WXUNUSED(event)) void MainFrame::OnShowTransparent(wxCommandEvent& WXUNUSED(event)) { - if (IsTransparentBackgroundSupported()) + wxString reason; + if (IsTransparentBackgroundSupported(&reason)) { SeeThroughFrame *seeThroughFrame = new SeeThroughFrame; seeThroughFrame->Create(); seeThroughFrame->Show(true); } else - wxMessageBox("transparent window requires a composited screen"); + { + wxLogError("%s, can't create transparent window.", reason); + } } void MainFrame::OnShowEffect(wxCommandEvent& event)