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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Fred Kiefer <FredKiefer>
Submitted on:  Sun 08 Mar 2009 09:16:38 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 11 Mar 2009 10:09:54 AM UTCFredKieferStatusNone=>Fixed
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1