Fix assert in wxWindowX11::SetBackgroundColour(wxColour())
Setting invalid colour is supposed to work and reset the background to the default one, but asserted and then crashed due to triggering another assert while trying to repaint the window while the assert dialog was shown, in wxX11. Fix this in the most expedient way by just resetting the background colour to its initial value. A better fix would be to leave it invalid but provide an accessor returning the default value if the background colour is not defined.
This commit is contained in:
@@ -1653,7 +1653,14 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Window WXUNUSED(win
|
||||
|
||||
bool wxWindowX11::SetBackgroundColour(const wxColour& col)
|
||||
{
|
||||
wxWindowBase::SetBackgroundColour(col);
|
||||
if ( !wxWindowBase::SetBackgroundColour(col) )
|
||||
return false;
|
||||
|
||||
if ( !m_backgroundColour.IsOk() )
|
||||
{
|
||||
// Reset to the default colour as we must have a valid background.
|
||||
m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
|
||||
}
|
||||
|
||||
Display *xdisplay = (Display*) wxGlobalDisplay();
|
||||
int xscreen = DefaultScreen( xdisplay );
|
||||
|
Reference in New Issue
Block a user