From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 068D1C07E95 for ; Tue, 20 Jul 2021 14:39:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 770456100C for ; Tue, 20 Jul 2021 14:39:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 770456100C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5quL-0001Ap-DI for qemu-devel@archiver.kernel.org; Tue, 20 Jul 2021 10:39:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5qsW-0007XJ-JT for qemu-devel@nongnu.org; Tue, 20 Jul 2021 10:37:48 -0400 Received: from mout.gmx.net ([212.227.15.19]:50525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5qsU-00032I-Ig for qemu-devel@nongnu.org; Tue, 20 Jul 2021 10:37:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1626791860; bh=K1SUnOdP3v3Q1D0PQR5LrgIg43cSZSopOff/P+bg2cY=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=a4DloVJSa52EF3sy3YRimRNP5sBWCIztR5H/2J9Y7W9gJRy9795e0fuOYNwSS0k1K 0oRaYAq268kkOV/PM1+mzYnZaGToowji8NCFOrgJWljSTpkQ0zGnZ4PnysKQYy1rWq kl44j9VNUoydiBTDpsVZeduIzSut+kwlPSZGPDvI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.188.43] ([87.123.205.179]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N9dsV-1l0puL0fDh-015bOX; Tue, 20 Jul 2021 16:37:40 +0200 Subject: Re: [PATCH] ui/gtk: Fix relative mouse with multiple monitors To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= References: <20210629132410.286813-1-denniswoelfing@gmx.de> From: =?UTF-8?Q?Dennis_W=c3=b6lfing?= Message-ID: <5960c0d1-f44f-8ca0-1d2c-fa6eb6545314@gmx.de> Date: Tue, 20 Jul 2021 16:37:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:u89JHVTSwMrtZknWx2kFx33kA+gLBhjk2xosX6nDpzccU0N0O5T VAIbeukI3t8pHO7bxtB81jDeptNnAuZmVV4W68PZ89DALDTShlpvAmdsawIQDcLrOx/ft0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O4FqZyhE96q2PQJZpiN7sWPk44yX5HLibZ94N5 ri2TmOJj5FMK3vGx9XiF/yhEy+QJfV8wzTEvjia4RNTDxuUCZ0W/Ugrz28E2U5lhhdi3s12fh ENFYAy+cChAFnxLZDIxmDB6eufEP5x5Ygk6XMv9j4bRjtpgK+0NI/ADSqzZKKZn+/O/JB2ZGr u6mhdEo0vOUqVL3Y516t4vRQlL65bW0O+qd43p0xzPN1uuAn7R8e1bZJQ== Received-SPF: pass client-ip=212.227.15.19; envelope-from=denniswoelfing@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 19.07.21 13:31, Marc-Andr=C3=A9 Lureau wrote: > Hi Dennis > > On Tue, Jun 29, 2021 at 5:26 PM Dennis W=C3=B6lfing wrote: > > > To handle relative mouse input the event handler needs to move the mou= se > > away from the screen edges. Failing to do so results in the mouse > > getting stuck at invisible walls. However the current implementation f= or > > this is broken on hosts with multiple monitors. > > > > With multiple monitors the mouse can be located outside of the current > > monitor which is not handled by the current code. Also the monitor > > itself might be located at coordinates different from (0, 0). > > > > Signed-off-by: Dennis W=C3=B6lfing > > > Looks reasonable to me. In spice-gtk we have slightly different code, we > wrap at the middle of the monitor instead > (https://gitlab.freedesktop.org/spice/spice-gtk/-/blob/master/src/spice-= widget.c#L1214), > what do you think? Indeed, warping to the center of the monitor allows for simpler code and means that it will take longer until the cursors hits a border again. I'll send a v2 that warps to the middle of the monitor. > And also, spice-gtk has special cases for w32 and wayland, which behave > differently. I just tested QEMU on a Windows host and relative mouse input is quite broken both before and after this patch: As soon as the cursor leaves the window QEMU no longer receives mouse events until the cursor is moved back into the window. I haven't tested it with Wayland. So we should perhaps have similar special cases as in spice-gtk. However I'm not comfortable with writing a patch to fix this as I am not familiar with the Windows and Wayland APIs. > Gtk4 is also different, as device_warp() is gone (it will have to handle > it specifically again for the different platforms: > https://gitlab.gnome.org/malureau/rdw/-/blob/master/rdw/src/display.rs#L= 812) That is unfortunate. The code will need to be rewritten then when it updated for Gtk4.