From patchwork Tue Nov 4 13:45:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40153 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1DE1F21894 for ; Tue, 4 Nov 2014 13:47:18 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf701984lbg.5 for ; Tue, 04 Nov 2014 05:47:17 -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=ZdQbOBt4sY0SnAPBTACOiOIsSo0BzsNtbVK275BFdRSMOdHz71mkWuTfZFSgLJzPIj 8p685I190SO0/CP3C95cDNdxl8dxcZZjZ7f+E9/a20yj0qVLcyiqxi6z3TEe+Zj84/CM zR/dPmXLjHg4R3QryNMM4y11NmZDLzIKlLSo0V22JuyD/ckBkfv36VwsNZw09Mjl5lLF 0y8n3P4aBjD1CPtF1EC71CuuhNNtNKAfTvCtLzKakMik6UPC+DQucPlnOfoCmCYlEEpU s4D8DGK+VXiuMK+YraAgSBWUIfoSroZH/m/nJD+xPO+Fl7qMEblmF2GD5Z+S1ffcwNnT tXEQ== X-Gm-Message-State: ALoCoQk2gbopmYXTKZ0DJDBHe2QKsEPuqGRmmvCqV3ezdhdATXjXCOuo2zKk/5/EYa/aypejRTUM X-Received: by 10.112.48.98 with SMTP id k2mr549560lbn.15.1415108837945; Tue, 04 Nov 2014 05:47:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.10.39 with SMTP id f7ls196593lab.75.gmail; Tue, 04 Nov 2014 05:47:17 -0800 (PST) X-Received: by 10.152.45.98 with SMTP id l2mr22770631lam.85.1415108837580; Tue, 04 Nov 2014 05:47:17 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id w8si941866lbb.16.2014.11.04.05.47.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:47:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id gq15so912811lab.1 for ; Tue, 04 Nov 2014 05:47:17 -0800 (PST) X-Received: by 10.112.14.69 with SMTP id n5mr59124151lbc.34.1415108837328; Tue, 04 Nov 2014 05:47:17 -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 ew9csp116813lbc; Tue, 4 Nov 2014 05:47:16 -0800 (PST) X-Received: by 10.224.112.2 with SMTP id u2mr6091082qap.14.1415108835483; Tue, 04 Nov 2014 05:47:15 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u3si635936qae.128.2014.11.04.05.47.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:47:15 -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]:40654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleS2-0000f6-LU for patch@linaro.org; Tue, 04 Nov 2014 08:47:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleQv-0007rf-OX for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:46:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XleQl-0003Zw-HC for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:46:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleQl-0003Zl-8t for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:45:55 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA4DjqR4019425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Nov 2014 08:45:53 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA4Djq2f007764; Tue, 4 Nov 2014 08:45:52 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 6F13781A75; Tue, 4 Nov 2014 14:45:51 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 4 Nov 2014 14:45:43 +0100 Message-Id: <1415108746-21448-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1415108746-21448-1-git-send-email-kraxel@redhat.com> References: <1415108746-21448-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 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 v2 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.42 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();