Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.windows.x Subject: Re: How do *you* handle multiple displays? Message-ID: <1991Jun28.131900.28715@thunder.mcrcim.mcgill.edu> Date: 28 Jun 91 13:19:00 GMT References: <14246@maslow.ptolemy-ri.arc.nasa.gov> <14258@ptolemy-ri.arc.nasa.gov> Organization: McGill Research Centre for Intelligent Machines Lines: 25 [ about a program interacting with multiple displays ] > What about the case when the toolkit is not being used? There is no simple solution. You have to depend on Xlib internals to some extent. For example, on Berkeleyish systems, you can generally use select() to check the relevant file descriptors. The Xlib internals knowledge comes into play when you realize that you have to get these file descriptors from somewhere; you use XConnectionNumber for this. More generally, XConnectionNumber (or the ConnectionNumber macro) returns "a connection number for the specified display", to quote the Xlib document. It also says that "On a POSIX system, this is the file descriptor of the connection.", so the above is probably a reasonably safe thing to do, if you're willing to stick to UNIXish systems. (What about connections that don't have file descriptors? Does the above forbid such things? I don't know, but wouldn't mind finding out.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu