From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjmE3-0001vv-5M for qemu-devel@nongnu.org; Fri, 22 Nov 2013 03:36:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjmDx-000824-6D for qemu-devel@nongnu.org; Fri, 22 Nov 2013 03:36:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjmDw-00081z-VD for qemu-devel@nongnu.org; Fri, 22 Nov 2013 03:36:25 -0500 Message-ID: <1385109380.3681.29.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Fri, 22 Nov 2013 09:36:20 +0100 In-Reply-To: <528CD9FD.2060308@spineless.org> References: <1384848690.16718.139.camel@nilsson.home.kraxel.org> <1384935158.2005.34.camel@nilsson.home.kraxel.org> <528CC80B.7080601@spineless.org> <1384960445.2005.124.camel@nilsson.home.kraxel.org> <528CD9FD.2060308@spineless.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] console muti-head some more design input List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Baboval Cc: qemu-devel@nongnu.org Hi, > > With absolute pointer events the whole thing becomes a bit more tricky > > as we have to map input from multiple displays (QemuConsoles) to a > > single absolute pointing device (usb tablet). This is what Dave wants > > the screen layout for. I still think the input layer is the place to do > > this transformation. > > We solve this problem in our UI now. It's not enough to know the > offsets. You also need to know all the resolutions - the display window, > the guest, and the device coordinate system of the virtual pointing > device (we use a PV event ring instead of a USB tablet). > > If your UI can scale the guest output, that means you need to also store > the UI's window geometry in the QemuConsole to get the math right. qemu input layer uses a 0 -> 0x7fff range for absolute coordinates. So your ui code has to transform the pointer position to that, considering window scaling if needed, then pass it to the input code. Inout code passes it on to the input device, which again will scale it to the dimensions of the usb-tablet / pv device / whatever. For multihead support we need the additional step to transform (display, phys-x, phys-y) to (virtual-x, virtual-y) using the screen layout. IMO the input layer should to that. Quite some changes are need to handle that, but the input layer needs some love anyway. cheers, Gerd