From patchwork Tue Nov 4 10:41:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40109 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5E43D240A6 for ; Tue, 4 Nov 2014 10:42:34 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id c41sf3909995eek.8 for ; Tue, 04 Nov 2014 02:42:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=TcuUvFfuWH9m349b/erZ5tnTvUu76QliptzVy1Uhvis=; b=K/OAfpcZZmIyGNAhd0l9Vxu1eTt8Ozbxn7XOBna6SZB1EmUmk1D3wGSLfSZQQRntS+ dWVry4c1b5g0CE05g/Ipwtj2XAXKanfGoMwqo44PGBwjYWNFRUOCzP0fPWAkRT4sHDMe JFRiyjbGjGb/gyUEjo5qdhKamGtdO5wEKF2lP2qk1ZgTAY0gOQnDF7MKNWelYJqCayQt cYwfZgLjVsK1cGpdPPIPUL2PzUu0p2xBVeLGlvezu8qiLY7u0NNeIoDG5KLILiuUqT+X dYIMtyZID0iZ2ePYgTf9geSIooqBCilhZTntDQ2rBwpyX9kJmhJHWkBWBTMR3/PN33UW Imlw== X-Gm-Message-State: ALoCoQkTlTnFBTIDjFeIRwR4m8mEfBQPEFP5f4pCwasfevaj+6mZK8m7PwwcItH/hOuFe7H/G8i8 X-Received: by 10.152.3.168 with SMTP id d8mr8458495lad.0.1415097753417; Tue, 04 Nov 2014 02:42:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.36 with SMTP id v4ls263491laj.43.gmail; Tue, 04 Nov 2014 02:42:33 -0800 (PST) X-Received: by 10.152.5.38 with SMTP id p6mr57637499lap.44.1415097753237; Tue, 04 Nov 2014 02:42:33 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id lf2si43099lac.52.2014.11.04.02.42.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:42:33 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id gf13so638252lab.3 for ; Tue, 04 Nov 2014 02:42:33 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr57820065lbc.23.1415097753062; Tue, 04 Nov 2014 02:42:33 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp94995lbc; Tue, 4 Nov 2014 02:42:32 -0800 (PST) X-Received: by 10.229.111.201 with SMTP id t9mr15373056qcp.9.1415097751716; Tue, 04 Nov 2014 02:42:31 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r9si77724qag.33.2014.11.04.02.42.31 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:42:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:39648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlbZG-00074t-TQ for patch@linaro.org; Tue, 04 Nov 2014 05:42:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlbYH-00064T-Sr for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlbY7-000214-MY for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlbY7-00020q-En for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:19 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA4AfHBq019331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Nov 2014 05:41:17 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA4AfGDG002167; Tue, 4 Nov 2014 05:41:17 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id F0E3C81A75; Tue, 4 Nov 2014 11:41:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 4 Nov 2014 11:41:08 +0100 Message-Id: <1415097671-15343-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1415097671-15343-1-git-send-email-kraxel@redhat.com> References: <1415097671-15343-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Anthony Liguori , Cole Robinson Subject: [Qemu-devel] [PULL 2/5] gtk: Install fullscreen accelerator on toplevel window 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kraxel@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Cole Robinson Instead of installing it on the menu. This will be needed to keep the fullscreen keyboard shortcut working when we hide the menu (in future patches). On gtk < 3.8, this has the unfortunate side effect of no longer listing the key combo in the UI. We could manually change the label in that case, but it will look visually out of place, and I'm not sure if anyone really cares. Signed-off-by: Cole Robinson Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index 97ac4c9..af8b2d0 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1123,6 +1123,12 @@ static void gd_menu_full_screen(GtkMenuItem *item, void *opaque) gd_update_cursor(vc); } +static void gd_accel_full_screen(void *opaque) +{ + GtkDisplayState *s = opaque; + gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item)); +} + static void gd_menu_zoom_in(GtkMenuItem *item, void *opaque) { GtkDisplayState *s = opaque; @@ -1704,10 +1710,14 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s) gtk_menu_set_accel_group(GTK_MENU(view_menu), s->accel_group); s->full_screen_item = gtk_menu_item_new_with_mnemonic(_("_Fullscreen")); - gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item), - "/View/Full Screen"); - gtk_accel_map_add_entry("/View/Full Screen", GDK_KEY_f, - HOTKEY_MODIFIERS); + + gtk_accel_group_connect(s->accel_group, GDK_KEY_f, HOTKEY_MODIFIERS, 0, + g_cclosure_new_swap(G_CALLBACK(gd_accel_full_screen), s, NULL)); +#if GTK_CHECK_VERSION(3, 8, 0) + gtk_accel_label_set_accel( + GTK_ACCEL_LABEL(gtk_bin_get_child(GTK_BIN(s->full_screen_item))), + GDK_KEY_f, HOTKEY_MODIFIERS); +#endif gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->full_screen_item); separator = gtk_separator_menu_item_new();