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 - XStoreColor returns zero on failure
Summary: XStoreColor returns zero on failure
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.15
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-22 23:24 UTC by Thorsten Otto
Modified: 2017-08-28 02:03 UTC (History)
0 users

See Also:


Attachments
short example & suggested patch (1.07 KB, application/zip)
2017-08-22 23:24 UTC, Thorsten Otto
Details

Note You need to log in before you can comment on or make changes to this bug.
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