discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Starting apps problem


From: Fred Kiefer
Subject: Re: Starting apps problem
Date: Sat, 05 Nov 2005 17:53:27 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921

Fred Kiefer wrote:
> I had a deeper look at the GNustep code and now I see a few more
> possible causes for this problem. For example the method [XGServer
> screenList] puts the main screen first, where as [NSImage
> bestRepresentationForDevice:] expects to find a screen with its screen
> number in that array. And the method [XGServer _createAppIconPixmaps]
> relies on this special order of screens instead of using defscreen. And
> this order does correspond to the one specified in the Apple
> specification. Looks like NSImage is wrong here, it should loop over all
> screens to find the one it needs. I will try to correct this and you can
> give your Solaris environment another go.
> 

After having a second look at the NSImage code, I think that it does
things the wrong way. Here's the current code:

         int screen = [[[GSCurrentServer() attributes]
                          objectForKey: GSScreenNumber] intValue];
         deviceDescription = [[[NSScreen screens] objectAtIndex: screen]
                                deviceDescription];

It should not be asking the current server for the screen number (which
will always be the default screen number), but rather ask the current
context for its attributes and use that as device describtion. But here
a limitation of the GNustep code applies. In most cases we use only one
context, the default one create in [NSApplication _init] and this
context doesn't have any attributes. If we change this initialisation to
use the device description of the main screen, we would have a usable
device description all the time. When and if we ever have different
contexts the code in NSImage would already be able to deal with that:

deviceDescription = [GSCurrentContext() attributes];

Any comments on this change? Adam, I think you wrote most of this code,
what is your opinion? I know that this usage of context attributes is
not according to the Cocoa standard, but we can always extend the
defined attributes, can't we?

Fred




reply via email to

[Prev in Thread] Current Thread [Next in Thread]