Menu

#124 x2x does not work with Kahakai, works fine with Waimea

open
nobody
None
5
2004-03-05
2004-03-05
No

I wish I could give a "detailed description", but I
can't find any more information about it.

x2x is a program that lets you share your mouse and
keyboard between two X displays. That is, one X
display will listen to the mouse and keyboard of
another X display, saving you the need to keep moving
your hands.

I had x2x working fine with waimea, swapping between
displays like a nimble butterfly flitting from flower
to flower, or something.

However, when I changed to kahakai, x2x just... stopped
working. When I ran it at first, it worked fine.
However, as soon as I changed desktop or viewport, it
ceased to transfer control to the other X display, and
behaved as if no x2x were running. "ps" output shows
that x2x IS still running, sitting there doing
absolutely nothing.

I straced x2x to see what was going on.

I'll cut out 1700 or so lines of the output.

It seems that most of the time, x2x sits in a "select()":

select(1024, [3 4], NULL, NULL, NULL)

When this select returns, it does some ioctls, reads
from handle 3, and writes to handle 4, then goes back
to its select():

select(1024, [3 4], NULL, NULL, NULL) = 1 (in [3])
ioctl(3, FIONREAD, [32]) = 0
read(3,
"\6\0\33\0\n\6+\0?\0\0\0\3\0\240\1\0\0\0\0_\1\376\0a\374"...,
32) = 32
write(4,
"\225\2\t\0\6\0\240\0\0\0\0\0?\0\0\0\26\0\4\0\1\0\240\0"...,
36) = 36
ioctl(4, FIONREAD, [0]) = 0
ioctl(3, FIONREAD, [0]) = 0
ioctl(4, FIONREAD, [0]) = 0
select(1024, [3 4], NULL, NULL, NULL)

The main operation of x2x is a whole bunch of these.
This makes sense - it waits for input on the two
handles (3 and 4), and when it gets it, it relays it to
the other one.

Looking before that in the strace output, I find out
what the handles 3 and 4 refer to:

uname({sys="Linux", node="nihil.ict.ru.ac.za", ...}) = 0
socket(PF_UNIX, SOCK_STREAM, 0) = 3
uname({sys="Linux", node="nihil.ict.ru.ac.za", ...}) = 0
uname({sys="Linux", node="nihil.ict.ru.ac.za", ...}) = 0
connect(3, {sa_family=AF_UNIX,
path="/tmp/.X11-unix/X0"}, 19) = 0
uname({sys="Linux", node="nihil.ict.ru.ac.za", ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC) = 0

Nihil is the controlling display, by the by.

Here is the call that opens handle 4:

socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 4
setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0

I wasn't sure what it was connecting the socket to,
though. I even have the socket book at home, and
haven't gotten around to reading it. My bad, sorry.

Anyway, the strace output carries on in this vein,
while x2x is working. When I change desktop, nothing
happens in the strace output, or ever after.
The last line of the strace output is:

select(1024, [3 4], NULL, NULL, NULL <unfinished ...>

So it seems that when I change desktops, the socket
that x2x is reading from is no longer updated.

As I say, it works fine in waimea.

Any ideas?

Discussion


Log in to post a comment.