From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1Js7-0007b5-10 for qemu-devel@nongnu.org; Sat, 25 Feb 2012 10:49:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1Jrz-00078b-Ou for qemu-devel@nongnu.org; Sat, 25 Feb 2012 10:49:18 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:36123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1Jrz-000782-Ii for qemu-devel@nongnu.org; Sat, 25 Feb 2012 10:49:11 -0500 Message-ID: <4F4902F4.7030909@weilnetz.de> Date: Sat, 25 Feb 2012 16:49:08 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1329695104-15174-1-git-send-email-aliguori@us.ibm.com> <1329695104-15174-6-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1329695104-15174-6-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] gtk: add support for screen scaling and full screen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Am 20.02.2012 00:45, schrieb Anthony Liguori: > Basic menu items to enter full screen mode and zoom in/out. Unlike SDL, we > don't allow arbitrary scaling based on window resizing. The current > behavior > with SDL causes a lot of problems for me. > > Sometimes I accidentally resize the window a tiny bit while trying to > move it > (Ubuntu's 1-pixel window decorations don't help here). After that, > scaling is > now active and if the screen changes size again, badness ensues since the > aspect ratio is skewed. > > Allowing zooming by 25% in and out should cover most use cases. We can > add a > more flexible scaling later but for now, I think this is a more friendly > behavior. > > Signed-off-by: Anthony Liguori > --- > ui/gtk.c | 89 > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 files changed, 85 insertions(+), 4 deletions(-) > > diff --git a/ui/gtk.c b/ui/gtk.c > index 73051db..b9a9bc3 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c [...] > + s->zoom_in_item = > gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_IN, NULL); > + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_in_item), > + "/View/Zoom In"); > + gtk_accel_map_add_entry("/View/Zoom In", GDK_KEY_equal, > GDK_CONTROL_MASK | GDK_MOD1_MASK); > + gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_in_item); > + > + s->zoom_out_item = > gtk_image_menu_item_new_from_stock(GTK_STOCK_ZOOM_OUT, NULL); > + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->zoom_out_item), > + "/View/Zoom Out"); > + gtk_accel_map_add_entry("/View/Zoom Out", GDK_KEY_minus, > GDK_CONTROL_MASK | GDK_MOD1_MASK); > + gtk_menu_append(GTK_MENU(s->view_menu), s->zoom_out_item); > + > separator = gtk_separator_menu_item_new(); > gtk_menu_append(GTK_MENU(s->view_menu), separator); I think GDK_KEY_plus would be a better choice instead of GDK_KEY_equal because that's the key used to zoom in by GNOME terminal, most web browsers and many more programs. Usually there is also a "Zoom 100 %" with GDK_KEY_0 which resets zooming to 100 %. Regards, Stefan Weil