We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3770

Summary: XStoreColor returns zero on failure
Product: SDL Reporter: Thorsten Otto <halgara>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 1.2.15   
Hardware: x86_64   
OS: Linux   
Attachments: short example & suggested patch

Description Thorsten Otto 2017-08-22 23:24:04 UTC
Created attachment 2878 [details]
short example & suggested patch

The fix done in http://hg.libsdl.org/SDL/rev/3665bc284271 is wrong. The current code returns -1 if the calls *succeeds*, and does not call XSync(). The outcome of this is that the whole screen turns black when trying to open a 640x480x8 window on a true-color display (short example attached). I suggest to add the attached patch to fix this (yes i know that the 1.2 branch is obsolete, but the faulty patch causes really bad behaviour for a very common scenario).
Comment 1 Sam Lantinga 2017-08-28 02:03:40 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/464908ca2d22