@@ -64,7 +64,7 @@ void PDC_scr_close( void)
6464 return ;
6565}
6666
67- static XTextProperty xtpWinName , xtpIconName ;
67+ XTextProperty xtpWinName , xtpIconName ;
6868
6969void PDC_scr_free ( void )
7070{
@@ -76,8 +76,10 @@ void PDC_scr_free( void)
7676 XFree ( xwmhHints );
7777 XFree ( xshSize );
7878 XFreeGC ( dis , curr_gc );
79+ XUnloadFont ( dis , font );
7980 XCloseDisplay ( dis );
80- XFree ( xtpWinName .value );
81+ if ( xtpWinName .value )
82+ XFree ( xtpWinName .value );
8183 XFree ( xtpIconName .value );
8284#ifdef USING_COMBINING_CHARACTER_SCHEME
8385 PDC_expand_combined_characters ( 0 , NULL );
@@ -109,7 +111,7 @@ int PDC_scr_open(void)
109111 long event_mask = ExposureMask | KeyPressMask | ButtonPressMask | ClientMessage
110112 | ButtonReleaseMask | StructureNotifyMask | PointerMotionMask ;
111113 char * pcIconName = "Icon Name?" ;
112- char * pcWinName = "Insert Window Name Here" , * pcProgName = "Test App" ;
114+ char * pcProgName = "Test App" ;
113115 const char * font_name = "-misc-fixed-medium-r-normal--15-*10646-1*" ;
114116
115117 PDC_LOG (("PDC_scr_open called\n" ));
@@ -171,7 +173,6 @@ int PDC_scr_open(void)
171173 xchClass = XAllocClassHint ();
172174
173175 xshSize -> flags = PPosition | PSize ;
174- XStringListToTextProperty (& pcWinName , 1 , & xtpWinName );
175176 XStringListToTextProperty (& pcIconName , 1 , & xtpIconName );
176177
177178 xwmhHints -> initial_state = NormalState ;
@@ -181,8 +182,10 @@ int PDC_scr_open(void)
181182 xchClass -> res_name = pcProgName ;
182183 xchClass -> res_class = "Base Win" ;
183184
184- XSetWMProperties ( dis , win , & xtpWinName , & xtpIconName , NULL , 0 ,
185+ XSetWMProperties ( dis , win , NULL , & xtpIconName , NULL , 0 ,
185186 xshSize , xwmhHints , xchClass );
187+ if ( xtpWinName .value )
188+ XSetWMName ( dis , win , & xtpWinName );
186189 XSetWMProtocols ( dis , win , & wmDeleteMessage , 1 );
187190 XMapWindow (dis , win );
188191
0 commit comments