From patchwork Thu Feb 6 11:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368281 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EF781820 for ; Thu, 6 Feb 2020 11:30:28 +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 56A7320730 for ; Thu, 6 Feb 2020 11:30:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CGX/Rqls" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56A7320730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfMZ-0001mS-Df for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:30:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40179) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLV-0008Se-OQ for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLT-0001yj-EN for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:53358 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLT-0001wN-Ab for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZjHJ0Bqyt9dFXRMBUV2U+b5uGLlCm46yUZcuR0/UrW0=; b=CGX/Rqls7mMvgrsg93EZqL+umLKsI02iJYB1iRGpizV9iUSuj5xJbWHQnl45VjfP5+SaRu YW3a5y/jwZ1VIMOS3tzp95QBmWF3ws7OMez6tX0/jN4EUDheRruaLAA/CmHLW9mjBfB/jE qoud37t/cIF7kyuv8BJIuSGJWfXus6c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-LhWjibADNXq5_wgee-ThIQ-1; Thu, 06 Feb 2020 06:29:16 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E97A0101FC6C; Thu, 6 Feb 2020 11:29:14 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D444884DB8; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 05BEA9D7F; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 1/6] ui: add show-cursor option Date: Thu, 6 Feb 2020 12:29:03 +0100 Message-Id: <20200206112908.5002-2-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: LhWjibADNXq5_wgee-ThIQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" When enabled, this forces showing the mouse cursor, i.e. do not allow the guest to hide it. Defaults to off. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko Acked-by: Markus Armbruster --- qapi/ui.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/ui.json b/qapi/ui.json index e04525d8b44b..b9df7fe7b5cb 100644 --- a/qapi/ui.json +++ b/qapi/ui.json @@ -1144,6 +1144,8 @@ # @type: Which DisplayType qemu should use. # @full-screen: Start user interface in fullscreen mode (default: off). # @window-close: Allow to quit qemu with window close button (default: on). +# @show-cursor: Force showing the mouse cursor (default: off). +# Since: 5.0 # @gl: Enable OpenGL support (default: off). # # Since: 2.12 @@ -1153,6 +1155,7 @@ 'base' : { 'type' : 'DisplayType', '*full-screen' : 'bool', '*window-close' : 'bool', + '*show-cursor' : 'bool', '*gl' : 'DisplayGLMode' }, 'discriminator' : 'type', 'data' : { 'gtk' : 'DisplayGTK', From patchwork Thu Feb 6 11:29:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B8471398 for ; Thu, 6 Feb 2020 11:31:44 +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 D5A81214AF for ; Thu, 6 Feb 2020 11:31:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FqsU5Oyh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5A81214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfNn-00048h-2F for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:31:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40177) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLV-0008SW-MR for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLU-0001zI-Bn for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:59001 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLU-0001zA-88 for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RodwXT1V2+0JjqSWCZGAHL7wdPoLcCIjVfQumGdbC6U=; b=FqsU5OyhUH+p/7RnYlTIjyl6Sue+P9vHQ+hf/L5n1AS45jpnCXI1bV6+hYx1UcVbUKTPCR buuZ9XWcshlctwFgv88R/4pOc9r4gw/5X9h+1yjfngMXK1uY5RcIF3799xrhJ0ZJbtZ88A XBOwkEYMhhDkYcmV01XcDi+JaUgPOcs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-415-RRw9MzTtMDS8RGqbCROEwQ-1; Thu, 06 Feb 2020 06:29:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 282A11835A29; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF85110016DA; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0E0949D14; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 2/6] ui/gtk: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:04 +0100 Message-Id: <20200206112908.5002-3-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: RRw9MzTtMDS8RGqbCROEwQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- ui/gtk.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index d18892d1de61..78b197ade4c1 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -247,6 +247,7 @@ static void gd_update_cursor(VirtualConsole *vc) { GtkDisplayState *s = vc->s; GdkWindow *window; + bool allow_hide_cursor = true; if (vc->type != GD_VC_GFX || !qemu_console_is_graphic(vc->gfx.dcl.con)) { @@ -257,8 +258,13 @@ static void gd_update_cursor(VirtualConsole *vc) return; } + if (s->opts->has_show_cursor && s->opts->show_cursor) { + allow_hide_cursor = false; + } + window = gtk_widget_get_window(GTK_WIDGET(vc->gfx.drawing_area)); - if (s->full_screen || qemu_input_is_absolute() || s->ptr_owner == vc) { + if (allow_hide_cursor && + (s->full_screen || qemu_input_is_absolute() || s->ptr_owner == vc)) { gdk_window_set_cursor(window, s->null_cursor); } else { gdk_window_set_cursor(window, NULL); From patchwork Thu Feb 6 11:29:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368285 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDCDE14B4 for ; Thu, 6 Feb 2020 11:32:17 +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 73E1A214AF for ; Thu, 6 Feb 2020 11:32:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PydCvuJq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73E1A214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfOK-0004w9-Eu for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:32:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40229) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLW-0008Ui-GK for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLV-00023R-DU for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:53033 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLV-0001z6-8p for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4IyWKhwRUQwRI8lwf4+TcJFmra3ViPznqxEAADo0NuY=; b=PydCvuJq0JxMeVhaM7TRC118/UxEbKlSQTF6BnzdhJ3bwIWGdG1P/NVJXHJtFBcwqtoVFA LmmonSxBbOJef8JwRFphhaV45DinWRNw1nuhUOtkXbFq38jQd15X4cVbNMdR5nz2d+NwJQ yDssIHtlLDcEzqUltligZOPtLOdBjBM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-70-HhpVB1LMPvCykU-yEPHEeg-1; Thu, 06 Feb 2020 06:29:16 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EE2B1034B3B; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9C7B26FB0; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 165769D1E; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 3/6] ui/sdl: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:05 +0100 Message-Id: <20200206112908.5002-4-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: HhpVB1LMPvCykU-yEPHEeg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- ui/sdl2.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 9030f1c42efb..e18555b10a42 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -161,9 +161,15 @@ static void sdl_update_caption(struct sdl2_console *scon) } } -static void sdl_hide_cursor(void) +static void sdl_hide_cursor(struct sdl2_console *scon) { - if (!cursor_hide) { + bool allow_hide_cursor = true; + + if (scon->opts->has_show_cursor && scon->opts->show_cursor) { + allow_hide_cursor = false; + } + + if (!allow_hide_cursor) { return; } @@ -175,9 +181,15 @@ static void sdl_hide_cursor(void) } } -static void sdl_show_cursor(void) +static void sdl_show_cursor(struct sdl2_console *scon) { - if (!cursor_hide) { + bool allow_hide_cursor = true; + + if (scon->opts->has_show_cursor && scon->opts->show_cursor) { + allow_hide_cursor = false; + } + + if (!allow_hide_cursor) { return; } @@ -216,7 +228,7 @@ static void sdl_grab_start(struct sdl2_console *scon) SDL_WarpMouseInWindow(scon->real_window, guest_x, guest_y); } } else { - sdl_hide_cursor(); + sdl_hide_cursor(scon); } SDL_SetWindowGrab(scon->real_window, SDL_TRUE); gui_grab = 1; @@ -227,7 +239,7 @@ static void sdl_grab_end(struct sdl2_console *scon) { SDL_SetWindowGrab(scon->real_window, SDL_FALSE); gui_grab = 0; - sdl_show_cursor(); + sdl_show_cursor(scon); sdl_update_caption(scon); } @@ -658,7 +670,7 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, if (on) { if (!guest_cursor) { - sdl_show_cursor(); + sdl_show_cursor(scon); } if (gui_grab || qemu_input_is_absolute() || absolute_enabled) { SDL_SetCursor(guest_sprite); @@ -667,7 +679,7 @@ static void sdl_mouse_warp(DisplayChangeListener *dcl, } } } else if (gui_grab) { - sdl_hide_cursor(); + sdl_hide_cursor(scon); } guest_cursor = on; guest_x = x, guest_y = y; From patchwork Thu Feb 6 11:29:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368289 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BCE91398 for ; Thu, 6 Feb 2020 11:34:06 +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 719CA20730 for ; Thu, 6 Feb 2020 11:34:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OiyUv2wl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 719CA20730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfQ5-0007Oc-0x for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:34:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLV-0008T2-KN for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLU-00020M-LO for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:25997 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLU-0001sK-Hn for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yGM7ZkMiZ6BMOLpHtzcPIS6l33t7CB4OzRG+MiB3VeE=; b=OiyUv2wlzv6X3JwFqH2kDPN9Ryvg/Z+SxjOzbubZCOTHOOfxOEXsDqHkOMqXJQOlixViUk j/+ntApeXhpmgZ9nCFew1mM29TmLxZYImpN6X2hrbYbmVcDzG8PATCdehjkGjHwsja0m3P A7gaNWo7QEPlk6dVc6aantEPVw5Hadc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-x4dMfa6XOueJBKonlNLMyA-1; Thu, 06 Feb 2020 06:29:16 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1ADBD1034B3A; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEE118DC1B; Thu, 6 Feb 2020 11:29:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1EA979AA8; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 4/6] ui/cocoa: implement show-cursor option Date: Thu, 6 Feb 2020 12:29:06 +0100 Message-Id: <20200206112908.5002-5-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: x4dMfa6XOueJBKonlNLMyA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- ui/cocoa.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index fbb5b1b45f81..f7b323044582 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -125,6 +125,7 @@ typedef struct { NSWindow *normalWindow, *about_window; static DisplayChangeListener *dcl; static int last_buttons; +static int cursor_hide = 1; int gArgc; char **gArgv; @@ -1918,6 +1919,9 @@ static void cocoa_display_init(DisplayState *ds, DisplayOptions *opts) [(QemuCocoaAppController *)[[NSApplication sharedApplication] delegate] toggleFullScreen: nil]; }); } + if (opts->has_show_cursor && opts->show_cursor) { + cursor_hide = 0; + } dcl = g_malloc0(sizeof(DisplayChangeListener)); From patchwork Thu Feb 6 11:29:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368287 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 471B61398 for ; Thu, 6 Feb 2020 11:33:50 +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 1E61F20730 for ; Thu, 6 Feb 2020 11:33:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N2zL4OaY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E61F20730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfPp-00071A-7X for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:33:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLW-0008VS-Pa for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLV-00025b-Q1 for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:25952 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLV-00023P-Lx for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VV+baVbE0iCSyAaPQPldJWITCP9tg+jCQxrFr9GIeHA=; b=N2zL4OaYJH5WKKNUL3GwvdG6GOOqNxk9mkKIsznPfojvxvcfKJv2Z9m3k7WR6e/jb9FWg9 fffEx/OgwLLqNcmpqLg2oS2r/ByO3RrzptRu6pMQPi3QHbNmX5pJisITAs41+LyPVfuwve A27HTBFuDG7AozQmV9umFh+MIyqols4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-meAhyeVDNWqIl1E_aNHz2Q-1; Thu, 06 Feb 2020 06:29:17 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2ACA2801A02; Thu, 6 Feb 2020 11:29:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id C222226FA8; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 282391FCD6; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 5/6] ui: wire up legacy -show-cursor option Date: Thu, 6 Feb 2020 12:29:07 +0100 Message-Id: <20200206112908.5002-6-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: meAhyeVDNWqIl1E_aNHz2Q-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann --- include/sysemu/sysemu.h | 1 - vl.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 6358a324a711..7956e9054ade 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -41,7 +41,6 @@ extern const char *keyboard_layout; extern int win2k_install_hack; extern int alt_grab; extern int ctrl_grab; -extern int cursor_hide; extern int graphic_rotate; extern int no_shutdown; extern int old_param; diff --git a/vl.c b/vl.c index 7dcb0879c497..fd96d04578cd 100644 --- a/vl.c +++ b/vl.c @@ -168,7 +168,6 @@ int no_hpet = 0; int fd_bootchk = 1; static int no_reboot; int no_shutdown = 0; -int cursor_hide = 1; int graphic_rotate = 0; const char *watchdog; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; @@ -3553,7 +3552,8 @@ int main(int argc, char **argv, char **envp) no_shutdown = 1; break; case QEMU_OPTION_show_cursor: - cursor_hide = 0; + dpy.has_show_cursor = true; + dpy.show_cursor = true; break; case QEMU_OPTION_uuid: if (qemu_uuid_parse(optarg, &qemu_uuid) < 0) { From patchwork Thu Feb 6 11:29:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11368279 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09DA914B4 for ; Thu, 6 Feb 2020 11:30:28 +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 D613120730 for ; Thu, 6 Feb 2020 11:30:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gyd2FR+Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D613120730 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:36842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfMZ-0001l2-1D for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 06:30:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40176) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfLV-0008ST-KN for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfLT-0001xA-6R for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:43079 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfLT-0001uN-2L for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580988558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q1Ppgvtxuqv/cQY2jtSC5bIqDJzrtCGOk93IFYtq2aQ=; b=gyd2FR+QVXtGM61XkC7675Kudh1f3WbZZsDfU63sGnlGgxaTp0p+3e3nnUsOTe33BU0n1w JUpUJq/UwBcZMdj1rqkKOEKRtkNRjYMDSCDy/Mi4iw3AHJfn2LKlxBIFi6/EZojgXD9rbM STF6e06bFH6PYC7tL57szvzA+se4N20= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-5kfq3GsyN_K9M4d0yI73Pg-1; Thu, 06 Feb 2020 06:29:17 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D33D1835A14; Thu, 6 Feb 2020 11:29:16 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6EE05DA7D; Thu, 6 Feb 2020 11:29:15 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 31B801FCDA; Thu, 6 Feb 2020 12:29:09 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 6/6] ui: deprecate legacy -show-cursor option Date: Thu, 6 Feb 2020 12:29:08 +0100 Message-Id: <20200206112908.5002-7-kraxel@redhat.com> In-Reply-To: <20200206112908.5002-1-kraxel@redhat.com> References: <20200206112908.5002-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: 5kfq3GsyN_K9M4d0yI73Pg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: Peter Maydell , jtomko@redhat.com, libvir-list@redhat.com, Markus Armbruster , jpewhacker@gmail.com, Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- vl.c | 2 ++ qemu-deprecated.texi | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/vl.c b/vl.c index fd96d04578cd..2f8b9753b49d 100644 --- a/vl.c +++ b/vl.c @@ -3552,6 +3552,8 @@ int main(int argc, char **argv, char **envp) no_shutdown = 1; break; case QEMU_OPTION_show_cursor: + warn_report("The -show-cursor option is deprecated, " + "use -display {sdl,gtk},show-cursor=on instead"); dpy.has_show_cursor = true; dpy.show_cursor = true; break; diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index ea3e10bde398..c1444d1839bd 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -148,6 +148,11 @@ QEMU 5.0 introduced an alternative syntax to specify the size of the translation block cache, @option{-accel tcg,tb-size=}. The new syntax deprecates the previously available @option{-tb-size} option. +@subsection -show-cursor option (since 5.0) + +Use @option{-display sdl,show-cursor=on} or + @option{-display gtk,show-cursor=on} instead. + @section QEMU Machine Protocol (QMP) commands @subsection change (since 2.5.0)