From nobody Sun Feb 8 20:34:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490053760686698.2179922293401; Mon, 20 Mar 2017 16:49:20 -0700 (PDT) Received: from localhost ([::1]:35700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cq739-0001Gh-DQ for importer@patchew.org; Mon, 20 Mar 2017 19:49:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cq6Qt-0001t1-LG for qemu-devel@nongnu.org; Mon, 20 Mar 2017 19:09:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cq6Qm-00055B-Qx for qemu-devel@nongnu.org; Mon, 20 Mar 2017 19:09:47 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40089 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cq6Qm-00054e-Kg for qemu-devel@nongnu.org; Mon, 20 Mar 2017 19:09:40 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2KN8X0e028763 for ; Mon, 20 Mar 2017 19:09:40 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 29amb5t7da-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Mar 2017 19:09:39 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Mar 2017 19:09:39 -0400 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Mar 2017 19:09:35 -0400 Received: from b01ledav03.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2KN9Z5n45285476; Mon, 20 Mar 2017 23:09:35 GMT Received: from b01ledav03.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A1016B2054; Mon, 20 Mar 2017 19:09:31 -0400 (EDT) Received: from localhost (unknown [9.53.92.194]) by b01ledav03.gho.pok.ibm.com (Postfix) with ESMTP id 8596AB2046; Mon, 20 Mar 2017 19:09:31 -0400 (EDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 20 Mar 2017 18:08:16 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490051325-3770-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1490051325-3770-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17032023-0048-0000-0000-000001344C30 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006819; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00836553; UDB=6.00411161; IPR=6.00614322; BA=6.00005224; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014732; XFM=3.00000013; UTC=2017-03-20 23:09:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032023-0049-0000-0000-00003FD87989 Message-Id: <1490051325-3770-53-git-send-email-mdroth@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-20_16:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703200196 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [PATCH 52/81] ui: use evdev keymap when running under wayland X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" Wayland always uses evdev as its input source, so QEMU can use the existing evdev keymap data Signed-off-by: Daniel P. Berrange Tested-by: Stefan Hajnoczi Message-id: 20161201094117.16407-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann (cherry picked from commit a8ffb372a2202c65f42fdb69891ea68a2f274b55) Signed-off-by: Michael Roth --- include/ui/gtk.h | 4 ++++ ui/gtk.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/include/ui/gtk.h b/include/ui/gtk.h index 42ca0fe..b3b5005 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -18,6 +18,10 @@ #include #endif =20 +#ifdef GDK_WINDOWING_WAYLAND +#include +#endif + #if defined(CONFIG_OPENGL) #include "ui/egl-helpers.h" #include "ui/egl-context.h" diff --git a/ui/gtk.c b/ui/gtk.c index 406de4f..356f400 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -90,6 +90,9 @@ #ifndef GDK_IS_X11_DISPLAY #define GDK_IS_X11_DISPLAY(dpy) (dpy =3D=3D dpy) #endif +#ifndef GDK_IS_WAYLAND_DISPLAY +#define GDK_IS_WAYLAND_DISPLAY(dpy) (dpy =3D=3D dpy) +#endif #ifndef GDK_IS_WIN32_DISPLAY #define GDK_IS_WIN32_DISPLAY(dpy) (dpy =3D=3D dpy) #endif @@ -1054,6 +1057,10 @@ static int gd_map_keycode(GtkDisplayState *s, GdkDis= play *dpy, int gdk_keycode) qemu_keycode =3D translate_xfree86_keycode(gdk_keycode - 97); } #endif +#ifdef GDK_WINDOWING_WAYLAND + } else if (GDK_IS_WAYLAND_DISPLAY(dpy) && gdk_keycode < 158) { + qemu_keycode =3D translate_evdev_keycode(gdk_keycode - 97); +#endif } else if (gdk_keycode =3D=3D 208) { /* Hiragana_Katakana */ qemu_keycode =3D 0x70; } else if (gdk_keycode =3D=3D 211) { /* backslash */ --=20 2.7.4