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.
This commit is contained in:
Vadim Zeitlin
2018-10-24 01:37:44 +02:00
parent 708a408733
commit 67e51e7b6d

View File

@@ -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)