From patchwork Thu Oct 30 19:34:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 39935 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3FB8E2405B for ; Fri, 31 Oct 2014 16:14:34 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf902591eek.9 for ; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) 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: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=40dCau9QEUfoW/aTn4ibVjyHBakBq5IhVPB/Do4vYjU=; b=Xly8R5T6QR6kBMAdOG/9PX4AU9anO0MSlQFvXFGHbWZKNx1jUz538zQ0V++GrW5a8R oawIvbtqoW9+g+PLUJsMogf8IBT/Uul9QyQmUW1Gsalt1zFqT7sg+PNcj77MaFzNWSwa 1iSF8se5fAQjjpG6MyUZXe65rkAHcEhdrO2dLv7ZEzxnYgJlFuG4A4S6C2DChStlYJI+ +7XvMcFu6USV62Ry0drvYNAhjlCsYzNbSYmSt9DoA5tP98ru8gjspSPzHXEiqM1BMtpr LjffPQSKW+YEQ2ihmGpVXuzwXZ6p8sNKl34hd3CrYvJrsXWkF7CQCY1lHmsDbMR5pIDm +gfw== X-Gm-Message-State: ALoCoQn++z28E8DqZCAAGENIAj4ZE/CtClRSDr8JGOdbca02Iz6fCgRz0NrAYalNgSAVTOOxnjXG X-Received: by 10.112.32.163 with SMTP id k3mr27169lbi.17.1414772073387; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.5 with SMTP id ca5ls385694lad.68.gmail; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr27393171laa.71.1414772073119; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id f6si17518011lbc.6.2014.10.31.09.14.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id 10so6395189lbg.15 for ; Fri, 31 Oct 2014 09:14:33 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr27069290laz.27.1414772072928; Fri, 31 Oct 2014 09:14:32 -0700 (PDT) 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.84.229 with SMTP id c5csp226459lbz; Fri, 31 Oct 2014 09:14:30 -0700 (PDT) X-Received: by 10.140.33.164 with SMTP id j33mr36116172qgj.23.1414772064961; Fri, 31 Oct 2014 09:14:24 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t4si17676456qaj.125.2014.10.31.09.14.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Oct 2014 09:14:24 -0700 (PDT) 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]:38778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEqE-0007jb-IZ for patch@linaro.org; Fri, 31 Oct 2014 12:14:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkE8u-0007iz-Ed for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:31:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjvUm-0005ec-1D for qemu-devel@nongnu.org; Thu, 30 Oct 2014 15:35:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjvUl-0005eM-PR for qemu-devel@nongnu.org; Thu, 30 Oct 2014 15:34:55 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9UJYmFm009784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Oct 2014 15:34:49 -0400 Received: from colepc.home.com ([10.3.113.2]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9UJYkFO015792; Thu, 30 Oct 2014 15:34:48 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Thu, 30 Oct 2014 15:34:33 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: manday@gmx.net, Gerd Hoffmann , Cole Robinson Subject: [Qemu-devel] [PATCH 2/4] 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: crobinso@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.170 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 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 --- 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();