From patchwork Tue Nov 4 10:41:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40110 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 81380240A6 for ; Tue, 4 Nov 2014 10:43:59 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf1987982lbi.4 for ; Tue, 04 Nov 2014 02:43:58 -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=6kfQ0wppUb6sZXX9k/D19fX3XJ+ise1/+hX55iborZA=; b=a11eifjNVcO0TjeIs0dAR2b0VnPG8CJPERM2d0L7dueu0aEhPsyGcshBiEIm5FFpv3 M9ftZR6jW3eBC+0P1pchsKDVBWobnj1Xn6EfEqgzad5c3l9Cospj7v4YkXuK2QGjWoou QDZHWgJk5QsTjwe5cUsEUXvPKIZsUx0c9/4AQMNPVoBuJVEWjXDDkWdtOrIZ3eYeaKcK lU9F0zLBtPnpa455Wybq+XsuIBifUHmpYbeX8D8YAZUgoPUSlYb3metgG5RpiJXvc2Bf AQug8T4sbwUn34BWBAB89G9q9myGclB2uoEf0sy7E3GdE8tArTPHyh5HzbAuv+cp9bFL RrBA== X-Gm-Message-State: ALoCoQm1ho73Ot5B865GUoexPEL/ToY3w9cOlxfoCjKkAe8DzLxC+CvBP9vS2mH9qIZqfoBTDCLH X-Received: by 10.112.159.199 with SMTP id xe7mr234502lbb.21.1415097838343; Tue, 04 Nov 2014 02:43:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.99 with SMTP id bf3ls613707lab.24.gmail; Tue, 04 Nov 2014 02:43:58 -0800 (PST) X-Received: by 10.152.36.231 with SMTP id t7mr4843145laj.73.1415097838079; Tue, 04 Nov 2014 02:43:58 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id b4si10342lbd.70.2014.11.04.02.43.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:43:58 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so2462789lbi.36 for ; Tue, 04 Nov 2014 02:43:58 -0800 (PST) X-Received: by 10.112.12.35 with SMTP id v3mr58111119lbb.80.1415097837841; Tue, 04 Nov 2014 02:43:57 -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 ew9csp95134lbc; Tue, 4 Nov 2014 02:43:57 -0800 (PST) X-Received: by 10.140.20.175 with SMTP id 44mr69086627qgj.22.1415097836584; Tue, 04 Nov 2014 02:43:56 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w5si34069995qat.116.2014.11.04.02.43.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 02:43:56 -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]:39665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlbad-0000yk-7k for patch@linaro.org; Tue, 04 Nov 2014 05:43:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlbYJ-00065Y-Hu for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XlbY8-00021N-6y for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XlbY7-00021F-Vi for qemu-devel@nongnu.org; Tue, 04 Nov 2014 05:41:20 -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 sA4AfHIG011579 (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 sA4AfGB9002169; Tue, 4 Nov 2014 05:41:17 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id DE7A581A74; Tue, 4 Nov 2014 11:41:15 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 4 Nov 2014 11:41:07 +0100 Message-Id: <1415097671-15343-2-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 1/5] gtk: Grab accel_group from GtkDisplayState 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.217.177 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 Rather than needlessly pass it around Signed-off-by: Cole Robinson Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index a5f6869..97ac4c9 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1605,13 +1605,13 @@ static void gd_connect_signals(GtkDisplayState *s) G_CALLBACK(gd_change_page), s); } -static GtkWidget *gd_create_menu_machine(GtkDisplayState *s, GtkAccelGroup *accel_group) +static GtkWidget *gd_create_menu_machine(GtkDisplayState *s) { GtkWidget *machine_menu; GtkWidget *separator; machine_menu = gtk_menu_new(); - gtk_menu_set_accel_group(GTK_MENU(machine_menu), accel_group); + gtk_menu_set_accel_group(GTK_MENU(machine_menu), s->accel_group); s->pause_item = gtk_check_menu_item_new_with_mnemonic(_("_Pause")); gtk_menu_shell_append(GTK_MENU_SHELL(machine_menu), s->pause_item); @@ -1692,7 +1692,7 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, return group; } -static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_group) +static GtkWidget *gd_create_menu_view(GtkDisplayState *s) { GSList *group = NULL; GtkWidget *view_menu; @@ -1701,7 +1701,7 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g int vc; view_menu = gtk_menu_new(); - gtk_menu_set_accel_group(GTK_MENU(view_menu), accel_group); + 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), @@ -1783,11 +1783,9 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g static void gd_create_menus(GtkDisplayState *s) { - GtkAccelGroup *accel_group; - - accel_group = gtk_accel_group_new(); - s->machine_menu = gd_create_menu_machine(s, accel_group); - s->view_menu = gd_create_menu_view(s, accel_group); + s->accel_group = gtk_accel_group_new(); + s->machine_menu = gd_create_menu_machine(s); + s->view_menu = gd_create_menu_view(s); s->machine_menu_item = gtk_menu_item_new_with_mnemonic(_("_Machine")); gtk_menu_item_set_submenu(GTK_MENU_ITEM(s->machine_menu_item), @@ -1798,9 +1796,8 @@ static void gd_create_menus(GtkDisplayState *s) gtk_menu_item_set_submenu(GTK_MENU_ITEM(s->view_menu_item), s->view_menu); gtk_menu_shell_append(GTK_MENU_SHELL(s->menu_bar), s->view_menu_item); - g_object_set_data(G_OBJECT(s->window), "accel_group", accel_group); - gtk_window_add_accel_group(GTK_WINDOW(s->window), accel_group); - s->accel_group = accel_group; + g_object_set_data(G_OBJECT(s->window), "accel_group", s->accel_group); + gtk_window_add_accel_group(GTK_WINDOW(s->window), s->accel_group); } static void gd_set_keycode_type(GtkDisplayState *s)