Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!SPURR.WR.USGS.GOV!gjw From: gjw@SPURR.WR.USGS.GOV (Gregory J. Woodhouse) Newsgroups: comp.windows.x Subject: What am I doing wrong? Message-ID: <9011201930.AA01212@spurr.wr.usgs.gov> Date: 20 Nov 90 19:30:51 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 52 Hi, I've got another (presumably) naive question for you. I use the following routine to read the window ID of the main window of another process from a property. My purpose in doing so is so that I can use XSendEvent. The problem is that XInternAtom returns None, even though the slave process should have created the property already. Here's the code: /*============================================================================* * fetch_win * *============================================================================*/ Bool fetch_win(display, sl_winp) Display *display; Window *sl_winp; /* RETURN */ { /* fetch slave window ID from display manager */ int status; Window rootwindow; Atom slwin_atom; /* These pointers are used for return values from XGetWindowProperty */ int *actual_format; Atom *actual_type; unsigned long *nitems; unsigned long *bytes_after; unsigned char **data; rootwindow = RootWindow(display, DefaultScreen(display)); slwin_atom = XInternAtom(display, PROP_NAME, True); /* only if exists -- this end reads the property */ if (slwin_atom == (Atom) None) { perror("master: XInternAtom"); return(False); } else status = XGetWindowProperty(display, rootwindow, slwin_atom, 0L, 1L, False, XA_WINDOW, actual_type, actual_format, nitems, bytes_after, data); if (*actual_format != 32 || *actual_type != XA_WINDOW || *nitems != 1L) { perror("master: property format"); return(False); } if (status != Success) { (void) fprintf(stderr, "%s: XGetWindowProperty failed", progname); return(False); } /* All went well. */ sl_winp = (Window *) data[0]; return(True); }