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 2532

Summary: SDL_SetWindowIcon fails silently
Product: SDL Reporter: Adam M. <adam>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: API change    
Priority: P2 CC: icculus, trick
Version: HG 2.1   
Hardware: x86_64   
OS: Windows 7   

Description Adam M. 2014-05-10 03:04:29 UTC
SDL_SetWindowIcon can fail (e.g. try setting a 64x64 icon), but there is no way to detect the failure. SDL_SetWindowIcon should return a result code like the other methods that can fail.
Comment 1 Adam M. 2014-05-10 03:11:47 UTC
A 64x64 icon in Windows 7, that is. (See #2533.) I imagine there are other reasons it can fail as well.
Comment 2 Ryan C. Gordon 2015-02-19 06:32:14 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!
Comment 3 Gerry JJ 2015-02-25 01:30:04 UTC
I don't know if this is expected, but SDL 2 is pickier than SDL 1 about what it'll accept as an icon. A game i've been porting to SDL 2 sets a 512x512 icon, and that used to work fine with SDL_WM_SetIcon in SDL 1, but fails with SDL_SetWindowIcon in SDL 2. 256x256 works. (Ubuntu 14.10 64-bit, Unity desktop)

By the way, Ubuntu's Unity dash will cache icons, so setting an icon may appear to work even if it doesn't. Renaming the executable to something new works around that.
Comment 4 Ryan C. Gordon 2015-04-07 04:57:56 UTC
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.
Comment 5 Ryan C. Gordon 2015-04-08 06:35:19 UTC
This is an API change, so we'll hold off on this until 2.1. As such, I've removed the target-2.0.4 keyword and will leave this bug open.

Related Bug #2533 is still being looked at for 2.0.4, however!

--ryan.
Comment 6 Sam Lantinga 2017-08-14 13:48:58 UTC
Marking this for review for SDL 2.1