On Wed, 28 Oct 2009, Tamas TEVESZ wrote:

Hi,

>  > hb_gtInfo( HB_GTI_WINTITLE, "string with accented chars" )
>  > doesn't seem to respect app CP (like now f.e. GTWVT does)
>  > with GTXWC, accented chars don't appear correctly in title
>  > bar.
>  > I tried to fix it by converting to UTF8 in gtxwc.c, but I
>  > may be missing something as it's still not right.
> this is a shot in the dark, but anyway.
> try adding
> XChangeProperty( wnd->dpy, wnd->window,
>       XInternAtom( wnd->dpy, "_NET_WM_NAME", False ),
>       XInternAtom( wnd->dpy, "UTF8_STRING", False ),
>       8, PropModeReplace, wnd->szTitle, strlen( wnd->szTitle ));
> right after calling XStoreName() in gtxwc.c (line 2965).

It will work and in such case it should be enough to replace
XStoreName() with above XChangeProperty().
But I'm interesting why you used _NET_WM_NAME property instead
of WM_NAME used by XStoreName().
Anyhow for final version I suggest to use XSetWMName() instead
of manually update properties:

   if( wnd->fDspTitle )
   {
      wnd->fDspTitle = FALSE;
      if( wnd->szTitle )
      {
         ULONG ulLen = hb_cdpStringInUTF8Length( wnd->hostCDP, TRUE, 
wnd->szTitle, strlen( wnd->szTitle ) );
         char * pBuffer = ( char * ) hb_xgrab( ulLen + 1 );
         XTextProperty text;

         hb_cdpStrnToUTF8( wnd->hostCDP, TRUE, wnd->szTitle, strlen( 
wnd->szTitle ), pBuffer );
         text.value = ( unsigned char * ) pBuffer;
         text.encoding = s_atomUTF8String;
         text.format = 8;
         text.nitems = strlen( pBuffer );
         XSetWMName( wnd->dpy, wnd->window, &text );
         hb_xfree( pBuffer );
      }
      else
         XStoreName( wnd->dpy, wnd->window, "" );
   }

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to