From patchwork Tue Nov 4 13:45:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40156 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7686621894 for ; Tue, 4 Nov 2014 13:49:02 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id h11sf4016875wiw.7 for ; Tue, 04 Nov 2014 05:49:01 -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=hD/JmJkaNarSuIia2cGLOQZ1T6bgwf9uon9JuH8UqkN0i3a5ehHSDzZ1+J8/n42FWh ok4PxDzekZXsosv/J7AGDZvQtNjXOZfmrgN2kvjmEM2VhVqhT0wV4u9iqHirH2aZumdR 2F+YuDSu5/JWb66cVykCama6z7OSm/BvWdhJs9tNaLmcdSNyi5Z7JI3ZS5unNj9EORoO x9atMW7qp+l6TKQmUnFNWm4czJW6pj7kEQ5Pm07C4REO6VmbzBM5gvZ2QzocZXfZfL8I hBWfmGBsBFiTojiszleFMWP2sPKzgQECSQBkht4VQKIYQK4eTIzrahCTvktbUzn1QFnG It0A== X-Gm-Message-State: ALoCoQkgjq1HzN2UHrK6oHirfYIDLdlCg+rWwdy4CZ/EZAal08ODRWChlyLDThsOAgcS1kP7SaEC X-Received: by 10.180.39.66 with SMTP id n2mr4208629wik.6.1415108941695; Tue, 04 Nov 2014 05:49:01 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.133 with SMTP id b5ls809903lah.26.gmail; Tue, 04 Nov 2014 05:49:01 -0800 (PST) X-Received: by 10.112.171.6 with SMTP id aq6mr11930053lbc.28.1415108941443; Tue, 04 Nov 2014 05:49:01 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id u16si876376laz.45.2014.11.04.05.49.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:49:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id ge10so876639lab.22 for ; Tue, 04 Nov 2014 05:49:01 -0800 (PST) X-Received: by 10.152.29.8 with SMTP id f8mr59547283lah.56.1415108941341; Tue, 04 Nov 2014 05:49:01 -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 ew9csp117002lbc; Tue, 4 Nov 2014 05:49:00 -0800 (PST) X-Received: by 10.224.11.135 with SMTP id t7mr77339739qat.94.1415108939680; Tue, 04 Nov 2014 05:48:59 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id gc8si868306qcb.7.2014.11.04.05.48.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Nov 2014 05:48:59 -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]:40667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleTi-0003kW-UM for patch@linaro.org; Tue, 04 Nov 2014 08:48:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleQr-0007mn-1w for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:46:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XleQk-0003ZV-Mi for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:46:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XleQk-0003ZL-GN for qemu-devel@nongnu.org; Tue, 04 Nov 2014 08:45:54 -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 sA4Djrsg031188 (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 sA4Djq5m007766; Tue, 4 Nov 2014 08:45:52 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 5DBF981A74; Tue, 4 Nov 2014 14:45:51 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 4 Nov 2014 14:45:42 +0100 Message-Id: <1415108746-21448-2-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 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.215.49 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)