[Xcb] Change touchscreen resolution with XChangeDeviceControl

Carlo E. Prelz fluido at fluido.as
Fri Jul 15 21:36:48 EST 2005

Happy day. I hope this forum is an acceptable place for posting my
question. I find myself in this situation: I have a microtouch
touchscreen, which I configure as core pointer. All works OK as long
as I set the proper values for the MinX, MaxX, MinY and MinY
parameters in xorg.conf.

My problem is that, while in my application (configured to run at
1280x1024), I  am starting a copy of tuxpaint, a program that you
probably know. Tuxpaintonly works at 640x480 or 800x600. 

With a normal mouse, there is no  problem in switching from one
resolution to the other. With the microtouch, I would have to provide
new parameters for MinX and friends so that the position of the finger
corresponds with that of the pointer. 

>From what I saw in the code for the microtouch driver (microtouch.c),
it is possible to assign new values by calling ControlProc (line 530),
which corresponds to the control_proc field in the local_device_stc
structure, filled on line 230.

This function is only used within
programs/Xserver/hw/xfree86/common/xf86Xinput.c, where it is executed
within ChangeDeviceControl. My knowledge of the X protocol is
decidedly fuzzy, but I believe that this function is connected with
the XLib function called XChangeDeviceControl.

So I have been trying to get to the possibility of calling
XChangeDeviceControl. The first problem I had was that, if I call
XOpenDevice on a device that is a core pointer, the open call will
fail. But I need a pointer to a XDevice structure to call
XChangeDeviceControl. How do I get the XDevice pointers for the core
pointer and the core keyboard?

Then I added a dummy mouse (module 'void_drv') and set that as core
pointer. Thus I was able to receive a XDevice structure pointer for
the touchscreen. But calling XGetDeviceControl always returns an

X Error of failed request:  BadValue (integer parameter out of range
for operation)
  Major opcode of failed request:  145 (XInputExtension)
  Minor opcode of failed request:  34 (X_GetDeviceControl)
  Value in failed request:  0x0
  Serial number of failed request:  12
  Current serial number in output stream:  12

No matter what value I chose for the controltype parameter - it is not
clear from the manpage what should this value be.

So: first of all, am I following the appropriate path to solve this
problem, or there is a brighter solution? And is there some practical
example about using XGetDeviceControl and friends?

Thanks in advance - Carlo, The Hague

  *         Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido at fluido.as             che bisogno ci sarebbe
  *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

More information about the xcb mailing list