> All the observations in this thread may be very right and 
> point to some problematic areas,

Yup - thread drift, and probably my fault.
I've been assuming that Manolo or Matt will fix this, as they are much
better on the OSX stuff...


> And according to it, it *must* happen in line 2083 of 
> Fl_mac.cxx (current svn):
> 
>    SetWindowTitleWithCFString(xid, utf8_title).
> 
> Cleary utf8_title is NULL because of the conversion in the 
> previous line.

That's this bit:

#if 1
    CFStringRef utf8_title = CFStringCreateWithCString(NULL, (name ?
name : ""), kCFStringEncodingUTF8);
    SetWindowTitleWithCFString(xid, utf8_title);
    CFRelease(utf8_title);
#else // old non-utf8 code to remove after new utf8 code approval :
    Str255 pTitle;
    if (name) {
      if (strlen(name) > 255) pTitle[0] = 255;
      else pTitle[0] = strlen(name);
      memcpy(pTitle+1, name, pTitle[0]);
    } 
    else 
      pTitle[0] = 0;
    SetWTitle(xid, pTitle);
#endif

So we have a number of options:

1: change the "#if 1" to "#if 0" to revert the old behaviour.

2: Test for utf8_title being NULL;

    CFStringRef utf8_title = CFStringCreateWithCString(NULL, (name ?
name : ""), kCFStringEncodingUTF8);
    if (utf8_title) {
      SetWindowTitleWithCFString(xid, utf8_title);
      CFRelease(utf8_title);
        }

This seems better - 
But what happens if we don't set a window title? 
And should we CFRelease(utf8_title) even if it is NULL?
I don't know enough OSX API to know...


Anyway, that seems like a simple enough change. I don't have access to a
Mac just now, does anyone know for sure if this change fixes the
problem?







SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to