bugGNUstep - Bugs: bug #25793, [NSImage imageNamed:...

Group
 
 

bug #25793: [NSImage imageNamed: @"GNUstep"] broken

Submitter:  Fred Kiefer <FredKiefer>
Submitted:  Sun 08 Mar 2009 09:16:38 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 11 Mar 2009 10:09:54 AM UTC, comment #2: 

I fixed this by making a copy of the application image before setting the name. This resolves the problem of this bug report.

I still think that the image proxy mechanism could cause other problems. For example you still get a proxy even when there no longer is an image with that name. Also identity comparision, like the ones in setApplicationIconImage: are unpredicable in the presence of proxies. When one of the images is the real one and the other the proxy the comparision will report false although we are dealing with the same basic image.

Fred Kiefer <FredKiefer>
Group Member
Mon 09 Mar 2009 10:36:07 PM UTC, comment #1: 

Looks like I was wrong in claiming that the theme changes is responcible for this problem. In a very simple case the code would work without the theme proxy, but more compilcated cases will face teh issue that any image may only have one name. This means the code in NSApplication that sets the name of the application icon to NSApplicationIcon must use a copy. And I think this is what it did until recently.

Fred Kiefer <FredKiefer>
Group Member
Sun 08 Mar 2009 09:16:38 PM UTC, original submission:  

I was using the old test application gui_test3 to track down my cairo drawing problem on SuSE 11.1 and noticed that nothing gets drawn, not just in cairo, but for all backends. After some bug hunting I understood that the proxy returned by [NSImage imageNamed: @"GNUstep"] was pointing to a nil image.

The next step was to add an NSLog statement at the end of NSImage setName: and this statement
NSLog(@"name %@ self %@ proxy %@", aName, self, proxy);
resulted in this output
2009-03-08 22:16:26.776 image_draw[15391] name GNUstep self <NSImage: 0x825e498> proxy <NSImage: 0x825e498>
2009-03-08 22:16:26.779 image_draw[15391] name NSApplicationIcon self <NSImage: 0x825e498> proxy <NSImage: 0x825e498>

Looks like the same image gets two different names assigned. Now this used to work and it most likely got broken by the proxy introduced for the theme handling. As that proxy is only needed for switching themes in the middle of running an application, I would like to suggest to take back that feature until we have it fully working. A correctly working imageNamed method seems much more important to me.


Fred Kiefer <FredKiefer>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-03-11 FredKiefer StatusNone Fixed
        Assigned toNone FredKiefer
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code