From patchwork Fri Mar 5 16:52:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Webb X-Patchwork-Id: 83788 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o25GqHgF009676 for ; Fri, 5 Mar 2010 16:52:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753940Ab0CEQwQ (ORCPT ); Fri, 5 Mar 2010 11:52:16 -0500 Received: from alpha.arachsys.com ([91.203.57.7]:34600 "EHLO alpha.arachsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753235Ab0CEQwP (ORCPT ); Fri, 5 Mar 2010 11:52:15 -0500 Received: from [83.104.159.199] (helo=miranda.arachsys.com) by alpha.arachsys.com with esmtpa (Exim 4.52) id 1Nnal0-00083R-4N; Fri, 05 Mar 2010 16:52:10 +0000 Received: from chris by miranda.arachsys.com with local (Exim 4.52) id 1Nnakz-0006Sd-Hp; Fri, 05 Mar 2010 16:52:09 +0000 Date: Fri, 5 Mar 2010 16:52:09 +0000 From: Chris Webb To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: Re: Another VNC crash, qemu-kvm-0.12.3 Message-ID: <20100305165209.GL29711@arachsys.com> References: <20100221172358.GH4894@arachsys.com> <4B82462A.7050903@redhat.com> <4B82F8ED.6000303@codemonkey.ws> <20100301181416.GB15908@arachsys.com> <4B8E70DB.4080108@codemonkey.ws> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4B8E70DB.4080108@codemonkey.ws> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 05 Mar 2010 16:52:18 +0000 (UTC) diff --git a/vnc.c b/vnc.c --- a/vnc.c +++ b/vnc.c @@ -1421,8 +1421,10 @@ dz = 1; if (vs->absolute) { - kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1), - y * 0x7FFF / (ds_get_height(vs->ds) - 1), + kbd_mouse_event(ds_get_width(vs->ds) > 1 ? + x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000, + ds_get_height(vs->ds) > 1 ? + y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000, dz, buttons); } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) { x -= 0x7FFF;