problem about XGetTextProperty()

Carsten Haitzler (The Rasterman) raster at rasterman.com
Tue Aug 15 21:58:41 PDT 2006


On Wed, 16 Aug 2006 11:18:04 +0800 "falls huang" <falls.huang at gmail.com>
babbled:

> Hello!
> 
>     I met a very strange problem. I wrote a simple program , if  I
> executed it in Konsole/xterm , the  XGetTextProperty() return OK;  if
> I executed it in gnome-terminal ,  it return error .
> 
>    what's the different between kde/gtk program ?

gtk apps stopped setting the icccm title props and instead started setting the
netwm title (not both) if netwm was a viable option for them.

> //////////////////////////////////
> 
> #include <X11/Xlib.h>
> #include <X11/Xutil.h>
> #include <X11/Xatom.h>
> 
> int main()
> {
>     XTextProperty text_prop;
>     int status;
>     Display *dpy=XOpenDisplay(NULL);
>     Window w;
>     int val;
> 
>     XGetInputFocus(dpy, &w, &val);
> 
>     status = XGetTextProperty(dpy,w,&text_prop,XA_WM_NAME);
> 
>     if (!status || !text_prop.value || !text_prop.nitems) {
>       printf("XGetTextProperty error status=%d\n" , status);
>       return -1;
>     }
>     printf("XGetTextProperty OK\n");
>     return 0;
> }
> 
> -- 
> Regards
> Falls Huang
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com
裸好多
Tokyo, Japan (東京 日本)



More information about the xorg mailing list