[comp.windows.x] Multiple displays for one client

loranb@sco.COM (Loran Ball) (11/25/89)

Is there a way for a single client to receive events from 
two displays efficiently and easily?

I can think of two solutions but I don't like either of them:

1) Poll for events with XCheckIfEvent().  Wastefull of CPU.

2) Fork a program to read events from the second display and 
   send them to the main program with XSendEvent().  
   This doesn't really provide a client with events from
   two displays directly.

Any advice would be appreciated.

Loran Ball   
uunet!sco!loranb

klee@chico.pa.dec.com (Ken Lee) (11/28/89)

In article <3900@scolex.sco.COM>, loranb@sco.COM (Loran Ball) writes:
> Is there a way for a single client to receive events from 
> two displays efficiently and easily?

If you're using a BSD-based UNIX, this is pretty efficient:

1.  process all events on the connections (lots of ways to do this)
2.  select() on the ConnectionNumber()'s for the connections
3.  goto 1

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@decwrl.dec.com
uucp: uunet!decwrl!klee