From patchwork Sat Jul 30 09:39:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 107497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 797AEB6F18 for ; Sat, 30 Jul 2011 20:25:52 +1000 (EST) Received: from localhost ([::1]:44855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn61h-0007cz-KC for incoming@patchwork.ozlabs.org; Sat, 30 Jul 2011 05:40:09 -0400 Received: from eggs.gnu.org ([140.186.70.92]:58396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn61A-00069Q-V1 for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qn610-0005cu-MA for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:31 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:58737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qn610-0005cF-93 for qemu-devel@nongnu.org; Sat, 30 Jul 2011 05:39:26 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate01.web.de (Postfix) with ESMTP id A733019476CD8; Sat, 30 Jul 2011 11:39:25 +0200 (CEST) Received: from [92.75.128.27] (helo=localhost.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1Qn60z-0001Sl-03; Sat, 30 Jul 2011 11:39:25 +0200 From: Jan Kiszka To: Anthony Liguori , qemu-devel Date: Sat, 30 Jul 2011 11:39:14 +0200 Message-Id: <6a407b6655b0a3e2f159c03fcb1cff45476b8bdb.1312018756.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX18+XihnycG///31SLG+znNfnD0vK+J46SbAPOCM bFhV7acT4XvfErgGgf0sjj4ihttcLrB3IfUXkYxU33vk7JZI3F 2Qu91su30= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Subject: [Qemu-devel] [PATCH 11/15] sdl: Fix cursor handling when switching consoles in absolute mouse mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka Restore the cursor when switching from graphic to text console while the mouse is in absolute mode. Disable it again when returning. Signed-off-by: Jan Kiszka --- ui/sdl.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/sdl.c b/ui/sdl.c index 662ffef..5ad38d5 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -452,7 +452,7 @@ static void sdl_show_cursor(void) if (!cursor_hide) return; - if (!kbd_mouse_is_absolute()) { + if (!kbd_mouse_is_absolute() || !is_graphic_console()) { SDL_ShowCursor(1); if (guest_cursor && (gui_grab || kbd_mouse_is_absolute() || absolute_enabled)) @@ -625,13 +625,20 @@ static void sdl_refresh(DisplayState *ds) /* Reset the modifiers sent to the current console */ reset_keys(); console_select(keycode - 0x02); + gui_keysym = 1; + if (gui_fullscreen) { + break; + } if (!is_graphic_console()) { /* release grab if going to a text console */ - if (gui_grab && !gui_fullscreen) { + if (gui_grab) { sdl_grab_end(); + } else if (absolute_enabled) { + sdl_show_cursor(); } + } else if (absolute_enabled) { + sdl_hide_cursor(); } - gui_keysym = 1; break; default: break;