Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Smile kde. about window name----help

    hi,I have a program with kde ,why windows' name is null with "XFetchName"
    follow 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)
                            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

    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


    thanks very much

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

  4. $spacer_open

Posting Permissions

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