Find the answer to your Linux question:
Results 1 to 3 of 3
hi,I have a program with kde ,why windows' name is null with "XFetchName" follow code: Code: #include <X11/Xlib.h> #include <stdio.h> static char *window_id_format = "0x%lx"; int main (void) { unsigned ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    2

    Smile kde. about window name----help


    hi,I have a program with kde ,why windows' name is null with "XFetchName"
    follow code:
    Code:
    #include <X11/Xlib.h>
    #include <stdio.h>
    
    static char *window_id_format = "0x%lx";
    int main (void)
    {
            unsigned int numkids, i, mapped, scrn;
            Window r, p, *kids;
            XWindowAttributes attr;
            Window root;
            Display *dipsy;
            char *win_name;
            dipsy = XOpenDisplay(0);
            scrn = DefaultScreen (dipsy);
            root = RootWindow (dipsy, scrn);
    
            mapped = 0;
            XQueryTree (dipsy, root, &r, &p, &kids, &numkids);
    
            for (i = 0; i < numkids; ++i)
            {
                    XGetWindowAttributes (dipsy, kids[i], &attr);
                    if (attr.map_state == IsViewable)
                    {
                            ++mapped;
                            printf (window_id_format, kids[i]);
    
                            if (!XFetchName (dipsy, kids[i], &win_name))
                            {
                                    printf ("(has no name %d \n)",mapped);
                                    XFree (win_name);
                            }
                            else if (win_name)
                            {
                                    printf (" %s \n", win_name);
                                    XFree (win_name);
                            }
                    }
            }
    }
    thanks very much~~

  2. #2
    Just Joined!
    Join Date
    Aug 2010
    Posts
    2

    Smile x-window,XFetchName get null

    I use XFetchName get window name ,I get null(has no name),but I can see title in the window,etc ,firefox named "xfetchname - Google serch - Mozilla Firefox",but i got null

    why?

    thanks very much

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,175
    Please provide the code you are using.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •