1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

Fix segfault in color picker

Previously, we released the color well's color even if it was the same
as the new color.  This eventually resulted in a segfault when calling
WMPaintColorSwatch because we tried calling XFillRectangle with no
display.

We fix this by only releasing/updating the color well's if it differs
from the new color.
This commit is contained in:
Torrance, Douglas
2021-06-29 19:21:32 +00:00
committed by Carlos R. Mafra
parent a6ec6a30a3
commit 75f133285f

View File

@@ -173,10 +173,10 @@ WMColorWell *WMCreateColorWell(WMWidget * parent)
void WMSetColorWellColor(WMColorWell * cPtr, WMColor * color)
{
if (cPtr->color)
if (cPtr->color && cPtr->color != color) {
WMReleaseColor(cPtr->color);
cPtr->color = WMRetainColor(color);
cPtr->color = WMRetainColor(color);
}
if (cPtr->colorView->flags.realized && cPtr->colorView->flags.mapped)
paintColorWell(cPtr);