All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
@ 2012-02-26 23:46 Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 1/8] console: allow VCs to be overridden by UI Anthony Liguori
                   ` (11 more replies)
  0 siblings, 12 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Weil, Alex Graf, Paolo Bonzini

I realize UIs are the third rail of QEMU development, but over the years I've
gotten a lot of feedback from users about our UI.  I think everyone struggles
with the SDL interface and its lack of discoverability but it's worse than I
think most people realize for users that rely on accessibility tools.

The two pieces of feedback I've gotten the most re: accessibility are the lack
of QEMU's enablement for screen readers and the lack of configurable
accelerators.

Since we render our own terminal using a fixed sized font, we don't respect
system font settings which means we ignore if the user has configured large
print.

We also don't integrate at all with screen readers which means that for blind
users, the virtual consoles may as well not even exist.

We also don't allow any type of configuration of accelerators.  For users with
limited dexterity (this is actually more common than you would think), they may
use an input device that only inputs one key at a time.  Holding down two keys
at once is not possible for these users.

These are solved problems though and while we could reinvent all of this
ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
solve these problems.

By using GTK, we can leverage VteTerminal for screen reader integration and font
configuration.  We can also use GTK's accelerator support to make accelerators
configurable (Gnome provides a global accelerator configuration interface).

I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
there eventually but that's not what this series is about.

This is just attempting to use a richer toolkit such that we can enable basic
accessibility support.  As a consequence, the UI is much more usable even for a
user without accessibility requirements so it's a win-win.

Also available at:

https://github.com/aliguori/qemu/tree/gtk.2

---
v1 -> v2
 - Add internationalization support.  I don't actually speak any other languages
   so I added a placeholder for a German translation.  This can be tested with
   LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
 - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
   sense now.
 - Fixed lots of issues raised in review comments (see individual patches)

Known Issues:
 - I saw the X crash once.  I think it has to do with widget sizes.  I need to
   work harder to reproduce.
 - I've not recreated the reported memory leak yet.
 - I haven't added backwards compatibility code for older VteTerminal widgets
   yet.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 1/8] console: allow VCs to be overridden by UI
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 2/8] chr: check to see if front end has registered a read function Anthony Liguori
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

We want to expose VCs using a VteTerminal widget.  We need access to provide our
own CharDriverState in order to do this.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 console.c   |   14 +++++++++++++-
 console.h   |    6 +++++-
 qemu-char.c |    2 +-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/console.c b/console.c
index 6a463f5..6434ed0 100644
--- a/console.c
+++ b/console.c
@@ -1513,7 +1513,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
         chr->init(chr);
 }
 
-CharDriverState *text_console_init(QemuOpts *opts)
+static CharDriverState *text_console_init(QemuOpts *opts)
 {
     CharDriverState *chr;
     TextConsole *s;
@@ -1549,6 +1549,18 @@ CharDriverState *text_console_init(QemuOpts *opts)
     return chr;
 }
 
+static VcHandler *vc_handler = text_console_init;
+
+int vc_init(QemuOpts *opts, CharDriverState **_chr)
+{
+    return vc_handler(opts, _chr);
+}
+
+void register_vc_handler(VcHandler *handler)
+{
+    vc_handler = handler;
+}
+
 void text_consoles_set_display(DisplayState *ds)
 {
     int i;
diff --git a/console.h b/console.h
index a95b581..56cda3c 100644
--- a/console.h
+++ b/console.h
@@ -356,7 +356,6 @@ void vga_hw_text_update(console_ch_t *chardata);
 
 int is_graphic_console(void);
 int is_fixedsize_console(void);
-CharDriverState *text_console_init(QemuOpts *opts);
 void text_consoles_set_display(DisplayState *ds);
 void console_select(unsigned int index);
 void console_color_init(DisplayState *ds);
@@ -364,6 +363,11 @@ void qemu_console_resize(DisplayState *ds, int width, int height);
 void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
                        int dst_x, int dst_y, int w, int h);
 
+typedef int (VcHandler)(QemuOpts *, CharDriverState **);
+
+int vc_init(QemuOpts *opts, CharDriverState **_chr);
+void register_vc_handler(VcHandler *handler);
+
 /* sdl.c */
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
 
diff --git a/qemu-char.c b/qemu-char.c
index bb9e3f5..5b2b35e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2707,7 +2707,7 @@ static const struct {
     { .name = "socket",    .open = qemu_chr_open_socket },
     { .name = "udp",       .open = qemu_chr_open_udp },
     { .name = "msmouse",   .open = qemu_chr_open_msmouse },
-    { .name = "vc",        .open = text_console_init },
+    { .name = "vc",        .open = vc_init },
 #ifdef _WIN32
     { .name = "file",      .open = qemu_chr_open_win_file_out },
     { .name = "pipe",      .open = qemu_chr_open_win_pipe },
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 2/8] chr: check to see if front end has registered a read function
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 1/8] console: allow VCs to be overridden by UI Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 3/8] ui: add basic GTK gui (v2) Anthony Liguori
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 qemu-char.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/qemu-char.c b/qemu-char.c
index 5b2b35e..22bfb29 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -160,7 +160,9 @@ int qemu_chr_be_can_write(CharDriverState *s)
 
 void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len)
 {
-    s->chr_read(s->handler_opaque, buf, len);
+    if (s->chr_read) {
+        s->chr_read(s->handler_opaque, buf, len);
+    }
 }
 
 int qemu_chr_fe_get_msgfd(CharDriverState *s)
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 3/8] ui: add basic GTK gui (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 1/8] console: allow VCs to be overridden by UI Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 2/8] chr: check to see if front end has registered a read function Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2) Anthony Liguori
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

This is minimalistic and just contains the basic widget infrastructure.  The GUI
consists of a menu and a GtkNotebook.  To start with, the notebook has its tabs
hidden which provides a UI that looks very similar to SDL with the exception of
the menu bar.

The menu bar allows a user to toggle the visibility of the tabs.  Cairo is used
for rendering.

I used gtk-vnc as a reference.  gtk-vnc solves the same basic problems as QEMU
since it was originally written as a remote display for QEMU.  So for the most
part, the approach to rendering and keyboard handling should be pretty solid for
GTK.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - add gtk-vnc license
 - fix key propagation
---
 Makefile      |    2 +
 Makefile.objs |    1 +
 configure     |   25 +++-
 console.h     |    4 +
 sysemu.h      |    1 +
 ui/gtk.c      |  572 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 604 insertions(+), 1 deletions(-)
 create mode 100644 ui/gtk.c

diff --git a/Makefile b/Makefile
index ad1e627..aa758dd 100644
--- a/Makefile
+++ b/Makefile
@@ -120,6 +120,8 @@ ui/cocoa.o: ui/cocoa.m
 
 ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
 
+ui/gtk.o: QEMU_CFLAGS += $(GTK_CFLAGS) $(VTE_CFLAGS)
+
 ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
 
 bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
diff --git a/Makefile.objs b/Makefile.objs
index 808de6a..86b63c0 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -147,6 +147,7 @@ ui-obj-y += keymaps.o
 ui-obj-$(CONFIG_SDL) += sdl.o sdl_zoom.o x_keymap.o
 ui-obj-$(CONFIG_COCOA) += cocoa.o
 ui-obj-$(CONFIG_CURSES) += curses.o
+ui-obj-$(CONFIG_GTK) += gtk.o
 vnc-obj-y += vnc.o d3des.o
 vnc-obj-y += vnc-enc-zlib.o vnc-enc-hextile.o
 vnc-obj-y += vnc-enc-tight.o vnc-palette.o
diff --git a/configure b/configure
index f9d5330..4c80673 100755
--- a/configure
+++ b/configure
@@ -250,7 +250,7 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 # default flags for all hosts
 QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS"
-QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
+QEMU_CFLAGS="-Wredundant-decls $QEMU_CFLAGS"
 QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
 QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
 QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu"
@@ -1498,6 +1498,23 @@ if test "$sparse" != "no" ; then
 fi
 
 ##########################################
+# GTK probe
+
+if test "$gtk" != "no"; then
+    if $pkg_config gtk+-2.0 --modversion >/dev/null 2>/dev/null && \
+       $pkg_config vte --modversion >/dev/null 2>/dev/null; then
+	gtk_cflags=`$pkg_config --cflags gtk+-2.0 2>/dev/null`
+	gtk_libs=`$pkg_config --libs gtk+-2.0 2>/dev/null`
+	vte_cflags=`$pkg_config --cflags vte 2>/dev/null`
+	vte_libs=`$pkg_config --libs vte 2>/dev/null`
+	libs_softmmu="$gtk_libs $vte_libs $libs_softmmu"
+	gtk="yes"
+    else
+	gtk="no"
+    fi
+fi
+
+##########################################
 # SDL probe
 
 # Look for sdl configuration program (pkg-config or sdl-config).  Try
@@ -2879,6 +2896,7 @@ if test "$darwin" = "yes" ; then
     echo "Cocoa support     $cocoa"
 fi
 echo "SDL support       $sdl"
+echo "GTK support       $gtk"
 echo "curses support    $curses"
 echo "curl support      $curl"
 echo "mingw32 support   $mingw32"
@@ -3162,6 +3180,11 @@ if test "$bluez" = "yes" ; then
   echo "BLUEZ_CFLAGS=$bluez_cflags" >> $config_host_mak
 fi
 echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
+if test "$gtk" = "yes" ; then
+  echo "CONFIG_GTK=y" >> $config_host_mak
+  echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
+  echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
+fi
 if test "$xen" = "yes" ; then
   echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
   echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
diff --git a/console.h b/console.h
index 56cda3c..9b4b390 100644
--- a/console.h
+++ b/console.h
@@ -398,4 +398,8 @@ static inline int vnc_display_pw_expire(DisplayState *ds, time_t expires)
 /* curses.c */
 void curses_display_init(DisplayState *ds, int full_screen);
 
+/* gtk.c */
+void early_gtk_display_init(void);
+void gtk_display_init(DisplayState *ds);
+
 #endif
diff --git a/sysemu.h b/sysemu.h
index 98118cc..7b46bb8 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -92,6 +92,7 @@ typedef enum DisplayType
     DT_DEFAULT,
     DT_CURSES,
     DT_SDL,
+    DT_GTK,
     DT_NOGRAPHIC,
     DT_NONE,
 } DisplayType;
diff --git a/ui/gtk.c b/ui/gtk.c
new file mode 100644
index 0000000..591a987
--- /dev/null
+++ b/ui/gtk.c
@@ -0,0 +1,572 @@
+/*
+ * GTK UI
+ *
+ * Copyright IBM, Corp. 2012
+ *
+ * Authors:
+ *  Anthony Liguori   <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ * Portions from gtk-vnc:
+ *
+ * GTK VNC Widget
+ *
+ * Copyright (C) 2006  Anthony Liguori <anthony@codemonkey.ws>
+ * Copyright (C) 2009-2010 Daniel P. Berrange <dan@berrange.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.0 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <vte/vte.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <pty.h>
+#include <math.h>
+
+#include "qemu-common.h"
+#include "console.h"
+#include "sysemu.h"
+#include "qmp-commands.h"
+#include "x_keymap.h"
+#include "keymaps.h"
+
+//#define DEBUG_GTK
+
+#ifdef DEBUG_GTK
+#define dprintf(fmt, ...) printf(fmt, ## __VA_ARGS__)
+#else
+#define dprintf(fmt, ...) do { } while (0)
+#endif
+
+typedef struct VirtualConsole
+{
+    GtkWidget *menu_item;
+    GtkWidget *terminal;
+    GtkWidget *scrolled_window;
+    CharDriverState *chr;
+    int fd;
+} VirtualConsole;
+
+typedef struct GtkDisplayState
+{
+    GtkWidget *window;
+
+    GtkWidget *menu_bar;
+
+    GtkWidget *file_menu_item;
+    GtkWidget *file_menu;
+    GtkWidget *quit_item;
+
+    GtkWidget *view_menu_item;
+    GtkWidget *view_menu;
+    GtkWidget *vga_item;
+
+    GtkWidget *show_tabs_item;
+
+    GtkWidget *vbox;
+    GtkWidget *notebook;
+    GtkWidget *drawing_area;
+    cairo_surface_t *surface;
+    DisplayChangeListener dcl;
+    DisplayState *ds;
+    int button_mask;
+    int last_x;
+    int last_y;
+
+    double scale_x;
+    double scale_y;
+
+    GdkCursor *null_cursor;
+    Notifier mouse_mode_notifier;
+} GtkDisplayState;
+
+static GtkDisplayState *global_state;
+
+/** Utility Functions **/
+
+static void gd_update_cursor(GtkDisplayState *s, gboolean override)
+{
+    GdkWindow *window;
+    bool on_vga;
+
+    window = gtk_widget_get_window(GTK_WIDGET(s->drawing_area));
+
+    on_vga = (gtk_notebook_get_current_page(GTK_NOTEBOOK(s->notebook)) == 0);
+
+    if ((override || on_vga) && kbd_mouse_is_absolute()) {
+	gdk_window_set_cursor(window, s->null_cursor);
+    } else {
+	gdk_window_set_cursor(window, NULL);
+    }
+}
+
+static void gd_update_caption(GtkDisplayState *s)
+{
+    const char *status = "";
+    gchar *title;
+
+    if (!runstate_is_running()) {
+        status = " [Stopped]";
+    }
+
+    if (qemu_name) {
+        title = g_strdup_printf("QEMU (%s)%s", qemu_name, status);
+    } else {
+        title = g_strdup_printf("QEMU%s", status);
+    }
+        
+    gtk_window_set_title(GTK_WINDOW(s->window), title);
+
+    g_free(title);
+}
+
+/** DisplayState Callbacks **/
+
+static void gd_update(DisplayState *ds, int x, int y, int w, int h)
+{
+    GtkDisplayState *s = ds->opaque;
+    int x1, x2, y1, y2;
+
+    dprintf("update(x=%d, y=%d, w=%d, h=%d)\n", x, y, w, h);
+
+    x1 = floor(x * s->scale_x);
+    y1 = floor(y * s->scale_y);
+
+    x2 = ceil(x * s->scale_x + w * s->scale_x);
+    y2 = ceil(y * s->scale_y + h * s->scale_y);
+
+    gtk_widget_queue_draw_area(s->drawing_area, x1, y1, (x2 - x1), (y2 - y1));
+}
+
+static void gd_refresh(DisplayState *ds)
+{
+    vga_hw_update();
+}
+
+static void gd_resize(DisplayState *ds)
+{
+    GtkDisplayState *s = ds->opaque;
+    cairo_format_t kind;
+    int stride;
+
+    dprintf("resize(width=%d, height=%d)\n",
+            ds->surface->width, ds->surface->height);
+
+    if (s->surface) {
+        cairo_surface_destroy(s->surface);
+    }
+
+    switch (ds->surface->pf.bits_per_pixel) {
+    case 8:
+        kind = CAIRO_FORMAT_A8;
+        break;
+    case 16:
+        kind = CAIRO_FORMAT_RGB16_565;
+        break;
+    case 32:
+        kind = CAIRO_FORMAT_RGB24;
+        break;
+    default:
+        g_assert_not_reached();
+        break;
+    }
+
+    stride = cairo_format_stride_for_width(kind, ds->surface->width);
+    g_assert_cmpint(ds->surface->linesize, ==, stride);
+
+    s->surface = cairo_image_surface_create_for_data(ds->surface->data,
+                                                     kind,
+                                                     ds->surface->width,
+                                                     ds->surface->height,
+                                                     ds->surface->linesize);
+
+    gtk_widget_set_size_request(s->drawing_area,
+                                ds->surface->width * s->scale_x,
+                                ds->surface->height * s->scale_y);
+}
+
+/** QEMU Events **/
+
+static void gd_change_runstate(void *opaque, int running, RunState state)
+{
+    GtkDisplayState *s = opaque;
+
+    gd_update_caption(s);
+}
+
+static void gd_mouse_mode_change(Notifier *notify, void *data)
+{
+    gd_update_cursor(container_of(notify, GtkDisplayState, mouse_mode_notifier),
+                     FALSE);
+}
+
+/** GTK Events **/
+
+static gboolean gd_window_close(GtkWidget *widget, GdkEvent *event,
+                                void *opaque)
+{
+    if (!no_quit) {
+        qmp_quit(NULL);
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+static gboolean gd_draw_event(GtkWidget *widget, cairo_t *cr, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+    int ww, wh;
+    int fbw, fbh;
+
+    fbw = s->ds->surface->width;
+    fbh = s->ds->surface->height;
+
+    gdk_drawable_get_size(gtk_widget_get_window(widget), &ww, &wh);
+
+    cairo_rectangle(cr, 0, 0, ww, wh);
+
+    if (ww != fbw || wh != fbh) {
+        s->scale_x = (double)ww / fbw;
+        s->scale_y = (double)wh / fbh;
+        cairo_scale(cr, s->scale_x, s->scale_y);
+    } else {
+        s->scale_x = 1.0;
+        s->scale_y = 1.0;
+    }
+
+    cairo_set_source_surface(cr, s->surface, 0, 0);
+    cairo_paint(cr);
+
+    return TRUE;
+}
+
+static gboolean gd_expose_event(GtkWidget *widget, GdkEventExpose *expose,
+                                void *opaque)
+{
+    cairo_t *cr;
+    gboolean ret;
+
+    cr = gdk_cairo_create(gtk_widget_get_window(widget));
+    cairo_rectangle(cr,
+                    expose->area.x,
+                    expose->area.y,
+                    expose->area.width,
+                    expose->area.height);
+    cairo_clip(cr);
+
+    ret = gd_draw_event(widget, cr, opaque);
+
+    cairo_destroy(cr);
+
+    return ret;
+}
+
+static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
+                                void *opaque)
+{
+    GtkDisplayState *s = opaque;
+    int dx, dy;
+    int x, y;
+
+    x = motion->x / s->scale_x;
+    y = motion->y / s->scale_y;
+
+    if (kbd_mouse_is_absolute()) {
+        dx = x * 0x7FFF / (s->ds->surface->width - 1);
+        dy = y * 0x7FFF / (s->ds->surface->height - 1);
+    } else if (s->last_x == -1 || s->last_y == -1) {
+        dx = 0;
+        dy = 0;
+    } else {
+        dx = x - s->last_x;
+        dy = y - s->last_y;
+    }
+
+    s->last_x = x;
+    s->last_y = y;
+
+    if (kbd_mouse_is_absolute()) {
+        kbd_mouse_event(dx, dy, 0, s->button_mask);
+    }
+
+    return TRUE;
+}
+
+static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
+                                void *opaque)
+{
+    GtkDisplayState *s = opaque;
+    int dx, dy;
+    int n;
+
+    if (button->button == 1) {
+        n = 0x01;
+    } else if (button->button == 2) {
+        n = 0x04;
+    } else if (button->button == 3) {
+        n = 0x02;
+    } else {
+        n = 0x00;
+    }
+
+    if (button->type == GDK_BUTTON_PRESS) {
+        s->button_mask |= n;
+    } else if (button->type == GDK_BUTTON_RELEASE) {
+        s->button_mask &= ~n;
+    }
+
+    if (kbd_mouse_is_absolute()) {
+        dx = s->last_x * 0x7FFF / (s->ds->surface->width - 1);
+        dy = s->last_y * 0x7FFF / (s->ds->surface->height - 1);
+    } else {
+        dx = 0;
+        dy = 0;
+    }
+
+    kbd_mouse_event(dx, dy, 0, s->button_mask);
+        
+    return TRUE;
+}
+
+static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque)
+{
+    int gdk_keycode;
+    int qemu_keycode;
+
+    gdk_keycode = key->hardware_keycode;
+
+    if (gdk_keycode < 9) {
+        qemu_keycode = 0;
+    } else if (gdk_keycode < 97) {
+        qemu_keycode = gdk_keycode - 8;
+    } else if (gdk_keycode < 158) {
+        qemu_keycode = translate_evdev_keycode(gdk_keycode - 97);
+    } else if (gdk_keycode == 208) { /* Hiragana_Katakana */
+        qemu_keycode = 0x70;
+    } else if (gdk_keycode == 211) { /* backslash */
+        qemu_keycode = 0x73;
+    } else {
+        qemu_keycode = 0;
+    }
+
+    dprintf("translated GDK keycode %d to QEMU keycode %d (%s)\n",
+            gdk_keycode, qemu_keycode,
+            (key->type == GDK_KEY_PRESS) ? "down" : "up");
+
+    if (qemu_keycode & SCANCODE_GREY) {
+        kbd_put_keycode(SCANCODE_EMUL0);
+    }
+
+    if (key->type == GDK_KEY_PRESS) {
+        kbd_put_keycode(qemu_keycode & SCANCODE_KEYCODEMASK);
+    } else if (key->type == GDK_KEY_RELEASE) {
+        kbd_put_keycode(qemu_keycode | SCANCODE_UP);
+    } else {
+        g_assert_not_reached();
+    }
+
+    return TRUE;
+}
+
+/** Window Menu Actions **/
+
+static void gd_menu_quit(GtkMenuItem *item, void *opaque)
+{
+    qmp_quit(NULL);
+}
+
+static void gd_menu_switch_vc(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->vga_item))) {
+        gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), 0);
+    }
+}
+
+static void gd_menu_show_tabs(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->show_tabs_item))) {
+        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(s->notebook), TRUE);
+    } else {
+        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(s->notebook), FALSE);
+    }
+}
+
+static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
+                           gpointer data)
+{
+    GtkDisplayState *s = data;
+
+    if (!gtk_widget_get_realized(s->notebook)) {
+        return;
+    }
+
+    gd_update_cursor(s, TRUE);
+}
+
+void early_gtk_display_init(void)
+{
+}
+
+/** Window Creation **/
+
+static void gd_connect_signals(GtkDisplayState *s)
+{
+    g_signal_connect(s->show_tabs_item, "activate",
+                     G_CALLBACK(gd_menu_show_tabs), s);
+
+    g_signal_connect(s->window, "delete-event",
+                     G_CALLBACK(gd_window_close), s);
+
+    g_signal_connect(s->drawing_area, "expose-event",
+                     G_CALLBACK(gd_expose_event), s);
+    g_signal_connect(s->drawing_area, "motion-notify-event",
+                     G_CALLBACK(gd_motion_event), s);
+    g_signal_connect(s->drawing_area, "button-press-event",
+                     G_CALLBACK(gd_button_event), s);
+    g_signal_connect(s->drawing_area, "button-release-event",
+                     G_CALLBACK(gd_button_event), s);
+    g_signal_connect(s->drawing_area, "key-press-event",
+                     G_CALLBACK(gd_key_event), s);
+    g_signal_connect(s->drawing_area, "key-release-event",
+                     G_CALLBACK(gd_key_event), s);
+
+    g_signal_connect(s->quit_item, "activate",
+                     G_CALLBACK(gd_menu_quit), s);
+    g_signal_connect(s->vga_item, "activate",
+                     G_CALLBACK(gd_menu_switch_vc), s);
+    g_signal_connect(s->notebook, "switch-page",
+                     G_CALLBACK(gd_change_page), s);
+}
+
+static void gd_create_menus(GtkDisplayState *s)
+{
+    GtkStockItem item;
+    GtkAccelGroup *accel_group;
+    GSList *group = NULL;
+    GtkWidget *separator;
+
+    accel_group = gtk_accel_group_new();
+    s->file_menu = gtk_menu_new();
+    gtk_menu_set_accel_group(GTK_MENU(s->file_menu), accel_group);
+    s->file_menu_item = gtk_menu_item_new_with_mnemonic("_File");
+
+    s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
+    gtk_stock_lookup(GTK_STOCK_QUIT, &item);
+    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->quit_item),
+                                 "<QEMU>/File/Quit");
+    gtk_accel_map_add_entry("<QEMU>/File/Quit", item.keyval, item.modifier);
+
+    s->view_menu = gtk_menu_new();
+    gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group);
+    s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View");
+
+    separator = gtk_separator_menu_item_new();
+    gtk_menu_append(GTK_MENU(s->view_menu), separator);
+
+    s->vga_item = gtk_radio_menu_item_new_with_mnemonic(group, "_VGA");
+    group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(s->vga_item));
+    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->vga_item),
+                                 "<QEMU>/View/VGA");
+    gtk_accel_map_add_entry("<QEMU>/View/VGA", GDK_KEY_1, GDK_CONTROL_MASK | GDK_MOD1_MASK);
+    gtk_menu_append(GTK_MENU(s->view_menu), s->vga_item);
+
+    separator = gtk_separator_menu_item_new();
+    gtk_menu_append(GTK_MENU(s->view_menu), separator);
+
+    s->show_tabs_item = gtk_check_menu_item_new_with_mnemonic("Show _Tabs");
+    gtk_menu_append(GTK_MENU(s->view_menu), s->show_tabs_item);
+
+    g_object_set_data(G_OBJECT(s->window), "accel_group", accel_group);
+    gtk_window_add_accel_group(GTK_WINDOW(s->window), accel_group);
+
+    gtk_menu_append(GTK_MENU(s->file_menu), s->quit_item);
+    gtk_menu_item_set_submenu(GTK_MENU_ITEM(s->file_menu_item), s->file_menu);
+    gtk_menu_shell_append(GTK_MENU_SHELL(s->menu_bar), s->file_menu_item);
+
+    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);
+}
+
+void gtk_display_init(DisplayState *ds)
+{
+    GtkDisplayState *s = g_malloc0(sizeof(*s));
+
+    gtk_init(NULL, NULL);
+
+    ds->opaque = s;
+    s->ds = ds;
+    s->dcl.dpy_update = gd_update;
+    s->dcl.dpy_resize = gd_resize;
+    s->dcl.dpy_refresh = gd_refresh;
+    register_displaychangelistener(ds, &s->dcl);
+
+    s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    s->vbox = gtk_vbox_new(FALSE, 0);
+    s->notebook = gtk_notebook_new();
+    s->drawing_area = gtk_drawing_area_new();
+    s->menu_bar = gtk_menu_bar_new();
+
+    s->scale_x = 1.0;
+    s->scale_y = 1.0;
+
+    s->null_cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
+
+    s->mouse_mode_notifier.notify = gd_mouse_mode_change;
+    qemu_add_mouse_mode_change_notifier(&s->mouse_mode_notifier);
+    qemu_add_vm_change_state_handler(gd_change_runstate, s);
+
+    gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), s->drawing_area, gtk_label_new("VGA"));
+
+    gd_create_menus(s);
+
+    gd_connect_signals(s);
+
+    gtk_widget_add_events(s->drawing_area,
+                          GDK_POINTER_MOTION_MASK |
+                          GDK_BUTTON_PRESS_MASK |
+                          GDK_BUTTON_RELEASE_MASK |
+                          GDK_BUTTON_MOTION_MASK |
+                          GDK_SCROLL_MASK |
+                          GDK_KEY_PRESS_MASK);
+    gtk_widget_set_double_buffered(s->drawing_area, FALSE);
+    gtk_widget_set_can_focus(s->drawing_area, TRUE);
+
+    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(s->notebook), FALSE);
+    gtk_notebook_set_show_border(GTK_NOTEBOOK(s->notebook), FALSE);
+
+    gtk_window_set_resizable(GTK_WINDOW(s->window), FALSE);
+
+    gd_update_caption(s);
+
+    gtk_box_pack_start(GTK_BOX(s->vbox), s->menu_bar, FALSE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(s->vbox), s->notebook, TRUE, TRUE, 0);
+
+    gtk_container_add(GTK_CONTAINER(s->window), s->vbox);
+
+    gtk_widget_show_all(s->window);
+
+    global_state = s;
+}
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (2 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 3/8] ui: add basic GTK gui (v2) Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-27 10:45   ` Kevin Wolf
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 5/8] gtk: add support for input grabbing Anthony Liguori
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

This enables VteTerminal to be used to render the text consoles.  VteTerminal is
the same widget used by gnome-terminal which means it's VT100 emulation is as
good as they come.

It's also screen reader accessible, supports copy/paste, proper scrolling and
most of the other features you would expect from a terminal widget.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v1 -> v2
 - make sure to activate the menu item when switching tabs
 - fix sizing of non-0 pages
---
 console.c |    4 +-
 console.h |    4 +-
 ui/gtk.c  |  160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 164 insertions(+), 4 deletions(-)

diff --git a/console.c b/console.c
index 6434ed0..c12f02a 100644
--- a/console.c
+++ b/console.c
@@ -1551,9 +1551,9 @@ static CharDriverState *text_console_init(QemuOpts *opts)
 
 static VcHandler *vc_handler = text_console_init;
 
-int vc_init(QemuOpts *opts, CharDriverState **_chr)
+CharDriverState *vc_init(QemuOpts *opts)
 {
-    return vc_handler(opts, _chr);
+    return vc_handler(opts);
 }
 
 void register_vc_handler(VcHandler *handler)
diff --git a/console.h b/console.h
index 9b4b390..27d7929 100644
--- a/console.h
+++ b/console.h
@@ -363,9 +363,9 @@ void qemu_console_resize(DisplayState *ds, int width, int height);
 void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
                        int dst_x, int dst_y, int w, int h);
 
-typedef int (VcHandler)(QemuOpts *, CharDriverState **);
+typedef CharDriverState *(VcHandler)(QemuOpts *);
 
-int vc_init(QemuOpts *opts, CharDriverState **_chr);
+CharDriverState *vc_init(QemuOpts *opts);
 void register_vc_handler(VcHandler *handler);
 
 /* sdl.c */
diff --git a/ui/gtk.c b/ui/gtk.c
index 591a987..0579a55 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -56,6 +56,8 @@
 #define dprintf(fmt, ...) do { } while (0)
 #endif
 
+#define MAX_VCS 10
+
 typedef struct VirtualConsole
 {
     GtkWidget *menu_item;
@@ -79,6 +81,9 @@ typedef struct GtkDisplayState
     GtkWidget *view_menu;
     GtkWidget *vga_item;
 
+    int nb_vcs;
+    VirtualConsole vc[MAX_VCS];
+
     GtkWidget *show_tabs_item;
 
     GtkWidget *vbox;
@@ -400,6 +405,15 @@ static void gd_menu_switch_vc(GtkMenuItem *item, void *opaque)
 
     if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->vga_item))) {
         gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), 0);
+    } else {
+        int i;
+
+        for (i = 0; i < s->nb_vcs; i++) {
+            if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->vc[i].menu_item))) {
+                gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), i + 1);
+                break;
+            }
+        }
     }
 }
 
@@ -418,16 +432,154 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                            gpointer data)
 {
     GtkDisplayState *s = data;
+    guint last_page;
 
     if (!gtk_widget_get_realized(s->notebook)) {
         return;
     }
 
+    last_page = gtk_notebook_get_current_page(nb);
+
+    if (last_page) {
+        gtk_widget_set_size_request(s->vc[last_page - 1].terminal, -1, -1);
+    }
+
+    if (arg2 == 0) {
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->vga_item), TRUE);
+    } else {
+        VirtualConsole *vc = &s->vc[arg2 - 1];
+        VteTerminal *term = VTE_TERMINAL(vc->terminal);
+        int width, height;
+
+        width = 80 * vte_terminal_get_char_width(term);
+        height = 25 * vte_terminal_get_char_height(term);
+
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE);
+        gtk_widget_set_size_request(vc->terminal, width, height);
+    }        
+
     gd_update_cursor(s, TRUE);
 }
 
+/** Virtual Console Callbacks **/
+
+static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
+{
+    VirtualConsole *vc = chr->opaque;
+
+    return write(vc->fd, buf, len);
+}
+
+static int nb_vcs;
+static CharDriverState *vcs[MAX_VCS];
+
+static CharDriverState *gd_vc_handler(QemuOpts *opts)
+{
+    CharDriverState *chr;
+
+    chr = g_malloc0(sizeof(*chr));
+    chr->chr_write = gd_vc_chr_write;
+
+    vcs[nb_vcs++] = chr;
+
+    return chr;
+}
+
 void early_gtk_display_init(void)
 {
+    register_vc_handler(gd_vc_handler);
+}
+
+static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque)
+{
+    VirtualConsole *vc = opaque;
+    uint8_t buffer[1024];
+    ssize_t len;
+
+    len = read(vc->fd, buffer, sizeof(buffer));
+    if (len <= 0) {
+        return FALSE;
+    }
+
+    qemu_chr_be_write(vc->chr, buffer, len);
+
+    return TRUE;
+}
+
+static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSList *group)
+{
+    const char *label;
+    char buffer[32];
+    char path[32];
+    VtePty *pty;
+    GIOChannel *chan;
+    GtkWidget *scrolled_window;
+    GtkAdjustment *hadjustment, *vadjustment;
+    int master_fd, slave_fd, ret;
+    struct termios tty;
+
+    snprintf(buffer, sizeof(buffer), "vc%d", index);
+    snprintf(path, sizeof(path), "<QEMU>/View/VC%d", index);
+
+    vc->chr = vcs[index];
+
+    if (vc->chr->label) {
+        label = vc->chr->label;
+    } else {
+        label = buffer;
+    }
+
+    vc->menu_item = gtk_radio_menu_item_new_with_mnemonic(group, label);
+    group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(vc->menu_item));
+    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(vc->menu_item), path);
+    gtk_accel_map_add_entry(path, GDK_KEY_2 + index, GDK_CONTROL_MASK | GDK_MOD1_MASK);
+
+    vc->terminal = vte_terminal_new();
+
+    ret = openpty(&master_fd, &slave_fd, NULL, NULL, NULL);
+    g_assert(ret != -1);
+
+    /* Set raw attributes on the pty. */
+    tcgetattr(slave_fd, &tty);
+    cfmakeraw(&tty);
+    tcsetattr(slave_fd, TCSAFLUSH, &tty);
+
+    pty = vte_pty_new_foreign(master_fd, NULL);
+
+    vte_terminal_set_pty_object(VTE_TERMINAL(vc->terminal), pty);
+
+    vte_terminal_set_scrollback_lines(VTE_TERMINAL(vc->terminal), -1);
+
+    vadjustment = vte_terminal_get_adjustment(VTE_TERMINAL(vc->terminal));
+    hadjustment = NULL;
+
+    scrolled_window = gtk_scrolled_window_new(NULL, vadjustment);
+    gtk_container_add(GTK_CONTAINER(scrolled_window), vc->terminal);
+
+    vte_terminal_set_size(VTE_TERMINAL(vc->terminal), 80, 25);
+
+    vc->fd = slave_fd;
+    vc->chr->opaque = vc;
+    vc->scrolled_window = scrolled_window;
+
+    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vc->scrolled_window),
+                                   GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+    gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), scrolled_window, gtk_label_new(label));
+    g_signal_connect(vc->menu_item, "activate",
+                     G_CALLBACK(gd_menu_switch_vc), s);
+
+    gtk_menu_append(GTK_MENU(s->view_menu), vc->menu_item);
+
+    qemu_chr_generic_open(vc->chr);
+    if (vc->chr->init) {
+        vc->chr->init(vc->chr);
+    }
+
+    chan = g_io_channel_unix_new(vc->fd);
+    g_io_add_watch(chan, G_IO_IN, gd_vc_in, vc);
+
+    return group;
 }
 
 /** Window Creation **/
@@ -467,6 +619,7 @@ static void gd_create_menus(GtkDisplayState *s)
     GtkAccelGroup *accel_group;
     GSList *group = NULL;
     GtkWidget *separator;
+    int i;
 
     accel_group = gtk_accel_group_new();
     s->file_menu = gtk_menu_new();
@@ -493,6 +646,13 @@ static void gd_create_menus(GtkDisplayState *s)
     gtk_accel_map_add_entry("<QEMU>/View/VGA", GDK_KEY_1, GDK_CONTROL_MASK | GDK_MOD1_MASK);
     gtk_menu_append(GTK_MENU(s->view_menu), s->vga_item);
 
+    for (i = 0; i < nb_vcs; i++) {
+        VirtualConsole *vc = &s->vc[i];
+
+        group = gd_vc_init(s, vc, i, group);
+        s->nb_vcs++;
+    }
+
     separator = gtk_separator_menu_item_new();
     gtk_menu_append(GTK_MENU(s->view_menu), separator);
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 5/8] gtk: add support for input grabbing
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (3 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2) Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2) Anthony Liguori
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

There is a small deviation from SDL's behavior here.  Instead of Ctrl+Alt
triggering grab, we now use Ctrl-Alt-g to trigger grab.

GTK will not accept Ctrl+Alt as an accelerator since it just consists of
modifiers.  Having grab as a proper accelerator is important as it allows a user
to override the accelerator for accessibility purposes.

We also are not automatically grabbing on left-click.  Besides the inability to
tie mouse clicks to an accelerator, I think this behavior is hard to discover
and since it only happens depending on the guest state, it can lead to confusing
behavior.

This can be changed in the future if there's a strong resistence to dropping
left-click-to-grab, but I think we're better off dropping it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 ui/gtk.c |  102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 0579a55..0dac807 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -79,6 +79,7 @@ typedef struct GtkDisplayState
 
     GtkWidget *view_menu_item;
     GtkWidget *view_menu;
+    GtkWidget *grab_item;
     GtkWidget *vga_item;
 
     int nb_vcs;
@@ -107,6 +108,11 @@ static GtkDisplayState *global_state;
 
 /** Utility Functions **/
 
+static bool gd_is_grab_active(GtkDisplayState *s)
+{
+    return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->grab_item));
+}
+
 static void gd_update_cursor(GtkDisplayState *s, gboolean override)
 {
     GdkWindow *window;
@@ -116,7 +122,8 @@ static void gd_update_cursor(GtkDisplayState *s, gboolean override)
 
     on_vga = (gtk_notebook_get_current_page(GTK_NOTEBOOK(s->notebook)) == 0);
 
-    if ((override || on_vga) && kbd_mouse_is_absolute()) {
+    if ((override || on_vga) &&
+        (kbd_mouse_is_absolute() || gd_is_grab_active(s))) {
 	gdk_window_set_cursor(window, s->null_cursor);
     } else {
 	gdk_window_set_cursor(window, NULL);
@@ -127,15 +134,20 @@ static void gd_update_caption(GtkDisplayState *s)
 {
     const char *status = "";
     gchar *title;
+    const char *grab = "";
+
+    if (gd_is_grab_active(s)) {
+        grab = " - Press Ctrl+Alt+G to release grab";
+    }
 
     if (!runstate_is_running()) {
         status = " [Stopped]";
     }
 
     if (qemu_name) {
-        title = g_strdup_printf("QEMU (%s)%s", qemu_name, status);
+        title = g_strdup_printf("QEMU (%s)%s%s", qemu_name, status, grab);
     } else {
-        title = g_strdup_printf("QEMU%s", status);
+        title = g_strdup_printf("QEMU%s%s", status, grab);
     }
         
     gtk_window_set_title(GTK_WINDOW(s->window), title);
@@ -309,10 +321,44 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
     s->last_x = x;
     s->last_y = y;
 
-    if (kbd_mouse_is_absolute()) {
+    if (kbd_mouse_is_absolute() || gd_is_grab_active(s)) {
         kbd_mouse_event(dx, dy, 0, s->button_mask);
     }
 
+    if (!kbd_mouse_is_absolute() && gd_is_grab_active(s)) {
+        GdkDrawable *drawable = GDK_DRAWABLE(gtk_widget_get_window(s->drawing_area));
+        GdkDisplay *display = gdk_drawable_get_display(drawable);
+        GdkScreen *screen = gdk_drawable_get_screen(drawable);
+        int x = (int)motion->x_root;
+        int y = (int)motion->y_root;
+
+        /* In relative mode check to see if client pointer hit
+         * one of the screen edges, and if so move it back by
+         * 200 pixels. This is important because the pointer
+         * in the server doesn't correspond 1-for-1, and so
+         * may still be only half way across the screen. Without
+         * this warp, the server pointer would thus appear to hit
+         * an invisible wall */
+        if (x == 0) {
+            x += 200;
+        }
+        if (y == 0) {
+            y += 200;
+        }
+        if (x == (gdk_screen_get_width(screen) - 1)) {
+            x -= 200;
+        }
+        if (y == (gdk_screen_get_height(screen) - 1)) {
+            y -= 200;
+        }
+
+        if (x != (int)motion->x_root || y != (int)motion->y_root) {
+            gdk_display_warp_pointer(display, screen, x, y);
+            s->last_x = -1;
+            s->last_y = -1;
+            return FALSE;
+        }
+    }        
     return TRUE;
 }
 
@@ -428,11 +474,39 @@ static void gd_menu_show_tabs(GtkMenuItem *item, void *opaque)
     }
 }
 
+static void gd_menu_grab_input(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    if (gd_is_grab_active(s)) {
+	gdk_keyboard_grab(gtk_widget_get_window(GTK_WIDGET(s->drawing_area)),
+			  FALSE,
+			  GDK_CURRENT_TIME);
+	gdk_pointer_grab(gtk_widget_get_window(GTK_WIDGET(s->drawing_area)),
+			 FALSE, /* All events to come to our window directly */
+			 GDK_POINTER_MOTION_MASK |
+			 GDK_BUTTON_PRESS_MASK |
+			 GDK_BUTTON_RELEASE_MASK |
+			 GDK_BUTTON_MOTION_MASK |
+			 GDK_SCROLL_MASK,
+			 NULL, /* Allow cursor to move over entire desktop */
+                         s->null_cursor,
+			 GDK_CURRENT_TIME);
+    } else {
+	gdk_keyboard_ungrab(GDK_CURRENT_TIME);
+	gdk_pointer_ungrab(GDK_CURRENT_TIME);
+    }
+
+    gd_update_caption(s);
+    gd_update_cursor(s, FALSE);
+}
+
 static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
                            gpointer data)
 {
     GtkDisplayState *s = data;
     guint last_page;
+    gboolean on_vga;
 
     if (!gtk_widget_get_realized(s->notebook)) {
         return;
@@ -444,6 +518,13 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
         gtk_widget_set_size_request(s->vc[last_page - 1].terminal, -1, -1);
     }
 
+    on_vga = arg2 == 0;
+
+    if (!on_vga) {
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
+                                       FALSE);
+    }
+
     if (arg2 == 0) {
         gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->vga_item), TRUE);
     } else {
@@ -458,6 +539,8 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
         gtk_widget_set_size_request(vc->terminal, width, height);
     }        
 
+    gtk_widget_set_sensitive(s->grab_item, on_vga);
+
     gd_update_cursor(s, TRUE);
 }
 
@@ -609,6 +692,8 @@ static void gd_connect_signals(GtkDisplayState *s)
                      G_CALLBACK(gd_menu_quit), s);
     g_signal_connect(s->vga_item, "activate",
                      G_CALLBACK(gd_menu_switch_vc), s);
+    g_signal_connect(s->grab_item, "activate",
+                     G_CALLBACK(gd_menu_grab_input), s);
     g_signal_connect(s->notebook, "switch-page",
                      G_CALLBACK(gd_change_page), s);
 }
@@ -639,6 +724,15 @@ static void gd_create_menus(GtkDisplayState *s)
     separator = gtk_separator_menu_item_new();
     gtk_menu_append(GTK_MENU(s->view_menu), separator);
 
+    s->grab_item = gtk_check_menu_item_new_with_mnemonic("_Grab Input");
+    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->grab_item),
+                                 "<QEMU>/View/Grab Input");
+    gtk_accel_map_add_entry("<QEMU>/View/Grab Input", GDK_KEY_g, GDK_CONTROL_MASK | GDK_MOD1_MASK);
+    gtk_menu_append(GTK_MENU(s->view_menu), s->grab_item);
+
+    separator = gtk_separator_menu_item_new();
+    gtk_menu_append(GTK_MENU(s->view_menu), separator);
+
     s->vga_item = gtk_radio_menu_item_new_with_mnemonic(group, "_VGA");
     group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(s->vga_item));
     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->vga_item),
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (4 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 5/8] gtk: add support for input grabbing Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-27 20:10   ` Stefan Weil
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 7/8] gtk: add translation support Anthony Liguori
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

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 <aliguori@us.ibm.com>
---
v1 -> v2
 - fix scaling (Paolo)
 - use ctrl-alt-+ instead of ctrl-alt-= for zoom
---
 ui/gtk.c |   92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 88 insertions(+), 4 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 0dac807..578cb94 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -79,6 +79,9 @@ typedef struct GtkDisplayState
 
     GtkWidget *view_menu_item;
     GtkWidget *view_menu;
+    GtkWidget *full_screen_item;
+    GtkWidget *zoom_in_item;
+    GtkWidget *zoom_out_item;
     GtkWidget *grab_item;
     GtkWidget *vga_item;
 
@@ -99,6 +102,7 @@ typedef struct GtkDisplayState
 
     double scale_x;
     double scale_y;
+    gboolean full_screen;
 
     GdkCursor *null_cursor;
     Notifier mouse_mode_notifier;
@@ -123,7 +127,7 @@ static void gd_update_cursor(GtkDisplayState *s, gboolean override)
     on_vga = (gtk_notebook_get_current_page(GTK_NOTEBOOK(s->notebook)) == 0);
 
     if ((override || on_vga) &&
-        (kbd_mouse_is_absolute() || gd_is_grab_active(s))) {
+        (s->full_screen || kbd_mouse_is_absolute() || gd_is_grab_active(s))) {
 	gdk_window_set_cursor(window, s->null_cursor);
     } else {
 	gdk_window_set_cursor(window, NULL);
@@ -215,9 +219,11 @@ static void gd_resize(DisplayState *ds)
                                                      ds->surface->height,
                                                      ds->surface->linesize);
 
-    gtk_widget_set_size_request(s->drawing_area,
-                                ds->surface->width * s->scale_x,
-                                ds->surface->height * s->scale_y);
+    if (!s->full_screen) {
+        gtk_widget_set_size_request(s->drawing_area,
+                                    ds->surface->width * s->scale_x,
+                                    ds->surface->height * s->scale_y);
+    }
 }
 
 /** QEMU Events **/
@@ -474,6 +480,54 @@ static void gd_menu_show_tabs(GtkMenuItem *item, void *opaque)
     }
 }
 
+static void gd_menu_full_screen(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->full_screen_item))) {
+        gtk_notebook_set_show_tabs(GTK_NOTEBOOK(s->notebook), FALSE);
+        gtk_widget_set_size_request(s->menu_bar, 0, 0);
+        gtk_widget_set_size_request(s->drawing_area, -1, -1);
+        gtk_window_set_resizable(GTK_WINDOW(s->window), TRUE);
+        gtk_window_fullscreen(GTK_WINDOW(s->window));
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item), TRUE);
+        s->full_screen = TRUE;
+    } else {
+        gtk_window_unfullscreen(GTK_WINDOW(s->window));
+        gd_menu_show_tabs(GTK_MENU_ITEM(s->show_tabs_item), s);
+        gtk_widget_set_size_request(s->menu_bar, -1, -1);
+        gtk_widget_set_size_request(s->drawing_area, s->ds->surface->width, s->ds->surface->height);
+        gtk_window_set_resizable(GTK_WINDOW(s->window), FALSE);
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item), FALSE);
+        s->full_screen = FALSE;
+    }
+
+    gd_update_cursor(s, FALSE);
+}
+
+static void gd_menu_zoom_in(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    s->scale_x += .25;
+    s->scale_y += .25;
+
+    gd_resize(s->ds);
+}
+
+static void gd_menu_zoom_out(GtkMenuItem *item, void *opaque)
+{
+    GtkDisplayState *s = opaque;
+
+    s->scale_x -= .25;
+    s->scale_y -= .25;
+
+    s->scale_x = MAX(s->scale_x, .25);
+    s->scale_y = MAX(s->scale_y, .25);
+
+    gd_resize(s->ds);
+}
+
 static void gd_menu_grab_input(GtkMenuItem *item, void *opaque)
 {
     GtkDisplayState *s = opaque;
@@ -523,6 +577,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
     if (!on_vga) {
         gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
                                        FALSE);
+    } else if (s->full_screen) {
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
+                                       TRUE);
     }
 
     if (arg2 == 0) {
@@ -690,6 +747,12 @@ static void gd_connect_signals(GtkDisplayState *s)
 
     g_signal_connect(s->quit_item, "activate",
                      G_CALLBACK(gd_menu_quit), s);
+    g_signal_connect(s->full_screen_item, "activate",
+                     G_CALLBACK(gd_menu_full_screen), s);
+    g_signal_connect(s->zoom_in_item, "activate",
+                     G_CALLBACK(gd_menu_zoom_in), s);
+    g_signal_connect(s->zoom_out_item, "activate",
+                     G_CALLBACK(gd_menu_zoom_out), s);
     g_signal_connect(s->vga_item, "activate",
                      G_CALLBACK(gd_menu_switch_vc), s);
     g_signal_connect(s->grab_item, "activate",
@@ -721,6 +784,27 @@ static void gd_create_menus(GtkDisplayState *s)
     gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group);
     s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View");
 
+    s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full Screen");
+    gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item),
+                                 "<QEMU>/View/Full Screen");
+    gtk_accel_map_add_entry("<QEMU>/View/Full Screen", GDK_KEY_f, GDK_CONTROL_MASK | GDK_MOD1_MASK);
+    gtk_menu_append(GTK_MENU(s->view_menu), s->full_screen_item);
+
+    separator = gtk_separator_menu_item_new();
+    gtk_menu_append(GTK_MENU(s->view_menu), separator);
+
+    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),
+                                 "<QEMU>/View/Zoom In");
+    gtk_accel_map_add_entry("<QEMU>/View/Zoom In", GDK_KEY_plus, 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),
+                                 "<QEMU>/View/Zoom Out");
+    gtk_accel_map_add_entry("<QEMU>/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);
 
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 7/8] gtk: add translation support
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (5 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2) Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-27  8:32   ` Paolo Bonzini
  2012-02-27 22:09   ` Stefan Weil
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 8/8] gtk: make default UI Anthony Liguori
                   ` (4 subsequent siblings)
  11 siblings, 2 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

The de_DE translation is just a placeholder so that I could test the
infrastructure.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 Makefile       |    3 +++
 configure      |    4 ++++
 po/Makefile    |   43 +++++++++++++++++++++++++++++++++++++++++++
 po/de_DE.po    |   37 +++++++++++++++++++++++++++++++++++++
 po/messages.po |   37 +++++++++++++++++++++++++++++++++++++
 ui/gtk.c       |   18 +++++++++++++-----
 6 files changed, 137 insertions(+), 5 deletions(-)
 create mode 100644 po/Makefile
 create mode 100644 po/de_DE.po
 create mode 100644 po/messages.po

diff --git a/Makefile b/Makefile
index aa758dd..d8f33f7 100644
--- a/Makefile
+++ b/Makefile
@@ -296,6 +296,9 @@ ifneq ($(BLOBS),)
 		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
 	done
 endif
+ifeq ($(CONFIG_GTK),y)
+	$(MAKE) -C po $@ || exit 1
+endif
 	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
 	set -e; for x in $(KEYMAPS); do \
 		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
diff --git a/configure b/configure
index 4c80673..7d5cb38 100755
--- a/configure
+++ b/configure
@@ -3916,6 +3916,10 @@ if [ "$source_path" != `pwd` ]; then
     mkdir -p libcacard
     rm -f libcacard/Makefile
     symlink "$source_path/libcacard/Makefile" libcacard/Makefile
+
+    mkdir -p po
+    rm -f po/Makefile
+    symlink "$source_path/po/Makefile" po/Makefile
 fi
 
 d=libuser
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..0e2c11b
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,43 @@
+# This makefile is very special as it's meant to build as part of the build
+# process and also within the source tree to update the translation files.
+
+VERSION=$(shell cat ../VERSION)
+TRANSLATIONS=de_DE
+SRCS=$(addsuffix .po, $(TRANSLATIONS))
+OBJS=$(addsuffix .mo, $(TRANSLATIONS))
+
+SRC_PATH=..
+
+-include ../config-host.mak
+
+vpath %.po $(SRC_PATH)/po
+
+all:
+	@echo Use 'make update' to update translation files
+	@echo or us 'make build' or 'make install' to build and install
+	@echo the translation files
+
+update: $(SRCS)
+
+build: $(OBJS)
+
+clean:
+	$(RM) $(OBJS)
+
+install: $(OBJS)
+	for obj in $(OBJS); do \
+	    base=`basename $$obj .mo`; \
+	    $(INSTALL) -d $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES; \
+	    $(INSTALL) -m644 $$obj $(DESTDIR)$(prefix)/share/locale/$$base/LC_MESSAGES/qemu.mo; \
+	done
+
+%.mo:
+	@msgfmt -o $@ $(SRC_PATH)/po/`basename $@ .mo`.po
+
+messages.po: $(SRC_PATH)/ui/gtk.c
+	@xgettext -o $@ --foreign-user --package-name=QEMU --package-version=1.0.50 --msgid-bugs-address=qemu-devel@nongnu.org -k_ -C $<
+
+de_DE.po: messages.po $(SRC_PATH)/ui/gtk.c
+	@msgmerge $@ $< > $@.bak && mv $@.bak $@
+
+.PHONY: $(SRCS) clean all
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100644
index 0000000..aa4ef42
--- /dev/null
+++ b/po/de_DE.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: QEMU 1.0.50\n"
+"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
+"POT-Creation-Date: 2012-02-26 11:30-0600\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../ui/gtk.c:769
+msgid "_File"
+msgstr "_File FIXME"
+
+#: ../ui/gtk.c:779
+msgid "_View"
+msgstr "_View FIXME"
+
+#: ../ui/gtk.c:781
+msgid "_Full Screen"
+msgstr "_Full Screen FIXME"
+
+#: ../ui/gtk.c:805
+msgid "_Grab Input"
+msgstr "_Grab Input FIXME"
+
+#: ../ui/gtk.c:831
+msgid "Show _Tabs"
+msgstr "Show _Tabs FIXME"
diff --git a/po/messages.po b/po/messages.po
new file mode 100644
index 0000000..741e782
--- /dev/null
+++ b/po/messages.po
@@ -0,0 +1,37 @@
+# SOME DESCRIPTIVE TITLE.
+# This file is put in the public domain.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: QEMU 1.0.50\n"
+"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
+"POT-Creation-Date: 2012-02-26 11:30-0600\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../ui/gtk.c:769
+msgid "_File"
+msgstr ""
+
+#: ../ui/gtk.c:779
+msgid "_View"
+msgstr ""
+
+#: ../ui/gtk.c:781
+msgid "_Full Screen"
+msgstr ""
+
+#: ../ui/gtk.c:805
+msgid "_Grab Input"
+msgstr ""
+
+#: ../ui/gtk.c:831
+msgid "Show _Tabs"
+msgstr ""
diff --git a/ui/gtk.c b/ui/gtk.c
index 578cb94..5b759bc 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -31,8 +31,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
+#define GETTEXT_PACKAGE "qemu"
+#define LOCALEDIR "po"
+
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
+#include <glib/gi18n.h>
 #include <vte/vte.h>
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -772,7 +776,7 @@ static void gd_create_menus(GtkDisplayState *s)
     accel_group = gtk_accel_group_new();
     s->file_menu = gtk_menu_new();
     gtk_menu_set_accel_group(GTK_MENU(s->file_menu), accel_group);
-    s->file_menu_item = gtk_menu_item_new_with_mnemonic("_File");
+    s->file_menu_item = gtk_menu_item_new_with_mnemonic(_("_File"));
 
     s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
     gtk_stock_lookup(GTK_STOCK_QUIT, &item);
@@ -782,9 +786,9 @@ static void gd_create_menus(GtkDisplayState *s)
 
     s->view_menu = gtk_menu_new();
     gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group);
-    s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View");
+    s->view_menu_item = gtk_menu_item_new_with_mnemonic(_("_View"));
 
-    s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full Screen");
+    s->full_screen_item = gtk_check_menu_item_new_with_mnemonic(_("_Full Screen"));
     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item),
                                  "<QEMU>/View/Full Screen");
     gtk_accel_map_add_entry("<QEMU>/View/Full Screen", GDK_KEY_f, GDK_CONTROL_MASK | GDK_MOD1_MASK);
@@ -808,7 +812,7 @@ static void gd_create_menus(GtkDisplayState *s)
     separator = gtk_separator_menu_item_new();
     gtk_menu_append(GTK_MENU(s->view_menu), separator);
 
-    s->grab_item = gtk_check_menu_item_new_with_mnemonic("_Grab Input");
+    s->grab_item = gtk_check_menu_item_new_with_mnemonic(_("_Grab Input"));
     gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->grab_item),
                                  "<QEMU>/View/Grab Input");
     gtk_accel_map_add_entry("<QEMU>/View/Grab Input", GDK_KEY_g, GDK_CONTROL_MASK | GDK_MOD1_MASK);
@@ -834,7 +838,7 @@ static void gd_create_menus(GtkDisplayState *s)
     separator = gtk_separator_menu_item_new();
     gtk_menu_append(GTK_MENU(s->view_menu), separator);
 
-    s->show_tabs_item = gtk_check_menu_item_new_with_mnemonic("Show _Tabs");
+    s->show_tabs_item = gtk_check_menu_item_new_with_mnemonic(_("Show _Tabs"));
     gtk_menu_append(GTK_MENU(s->view_menu), s->show_tabs_item);
 
     g_object_set_data(G_OBJECT(s->window), "accel_group", accel_group);
@@ -870,6 +874,10 @@ void gtk_display_init(DisplayState *ds)
     s->scale_x = 1.0;
     s->scale_y = 1.0;
 
+    setlocale(LC_ALL, "");
+    bindtextdomain("qemu", CONFIG_QEMU_PREFIX "/share/locale");
+    textdomain("qemu");
+
     s->null_cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
 
     s->mouse_mode_notifier.notify = gd_mouse_mode_change;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Qemu-devel] [PATCH 8/8] gtk: make default UI
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (6 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 7/8] gtk: add translation support Anthony Liguori
@ 2012-02-26 23:46 ` Anthony Liguori
  2012-02-27  7:23 ` [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) malc
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-26 23:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Stefan Weil, Anthony Liguori, Alex Graf, Paolo Bonzini

A user can still enable SDL with '-sdl' or '-display sdl' but start making the
default display GTK by default.

I'd also like to deprecate the SDL display and remove it in a few releases.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 vl.c |   38 ++++++++++++++++++++++++--------------
 1 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/vl.c b/vl.c
index 1d4c350..95d4e79 100644
--- a/vl.c
+++ b/vl.c
@@ -3290,6 +3290,25 @@ int main(int argc, char **argv, char **envp)
             add_device_config(DEV_VIRTCON, "vc:80Cx24C");
     }
 
+    if (display_type == DT_DEFAULT) {
+#if defined(CONFIG_GTK)
+        display_type = DT_GTK;
+#elif defined(CONFIG_SDL) || defined(CONFIG_COCOA)
+        display_type = DT_SDL;
+#elif defined(CONFIG_VNC)
+        vnc_display = "localhost:0,to=99";
+        show_vnc_port = 1;
+#else
+        display_type = DT_NONE;
+#endif
+    }
+
+#if defined(CONFIG_GTK)
+    if (display_type == DT_GTK) {
+        early_gtk_display_init();
+    }
+#endif
+
     socket_init();
 
     if (qemu_opts_foreach(qemu_find_opts("chardev"), chardev_init_func, NULL, 1) != 0)
@@ -3502,20 +3521,6 @@ int main(int argc, char **argv, char **envp)
     /* just use the first displaystate for the moment */
     ds = get_displaystate();
 
-    if (using_spice)
-        display_remote++;
-    if (display_type == DT_DEFAULT && !display_remote) {
-#if defined(CONFIG_SDL) || defined(CONFIG_COCOA)
-        display_type = DT_SDL;
-#elif defined(CONFIG_VNC)
-        vnc_display = "localhost:0,to=99";
-        show_vnc_port = 1;
-#else
-        display_type = DT_NONE;
-#endif
-    }
-
-
     /* init local displays */
     switch (display_type) {
     case DT_NOGRAPHIC:
@@ -3534,6 +3539,11 @@ int main(int argc, char **argv, char **envp)
         cocoa_display_init(ds, full_screen);
         break;
 #endif
+#if defined(CONFIG_GTK)
+    case DT_GTK:
+        gtk_display_init(ds);
+        break;
+#endif
     default:
         break;
     }
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (7 preceding siblings ...)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 8/8] gtk: make default UI Anthony Liguori
@ 2012-02-27  7:23 ` malc
  2012-02-27  8:21 ` Jan Kiszka
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: malc @ 2012-02-27  7:23 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

On Sun, 26 Feb 2012, Anthony Liguori wrote:

> I realize UIs are the third rail of QEMU development, but over the years I've
> gotten a lot of feedback from users about our UI.  I think everyone struggles
> with the SDL interface and its lack of discoverability but it's worse than I
> think most people realize for users that rely on accessibility tools.
> 
> The two pieces of feedback I've gotten the most re: accessibility are the lack
> of QEMU's enablement for screen readers and the lack of configurable
> accelerators.
> 
> Since we render our own terminal using a fixed sized font, we don't respect
> system font settings which means we ignore if the user has configured large
> print.
> 
> We also don't integrate at all with screen readers which means that for blind
> users, the virtual consoles may as well not even exist.
> 
> We also don't allow any type of configuration of accelerators.  For users with
> limited dexterity (this is actually more common than you would think), they may
> use an input device that only inputs one key at a time.  Holding down two keys
> at once is not possible for these users.
> 
> These are solved problems though and while we could reinvent all of this
> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
> solve these problems.
> 
> By using GTK, we can leverage VteTerminal for screen reader integration and font
> configuration.  We can also use GTK's accelerator support to make accelerators
> configurable (Gnome provides a global accelerator configuration interface).
> 
> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
> there eventually but that's not what this series is about.
> 
> This is just attempting to use a richer toolkit such that we can enable basic
> accessibility support.  As a consequence, the UI is much more usable even for a
> user without accessibility requirements so it's a win-win.
> 
> Also available at:
> 
> https://github.com/aliguori/qemu/tree/gtk.2
> 
> ---
> v1 -> v2
>  - Add internationalization support.  I don't actually speak any other languages
>    so I added a placeholder for a German translation.  This can be tested with
>    LANGUAGE=de_DE.UTF-8 qemu-system-x86_64

gnome-terminal, well basically every terminal that isn't konsole, is
utterly incapable of rendering anything with complex shaping 
(devanagari/gurumukhi/whatever for instance), i'd go on a limb and say
that it's defficiency in the underlying terminal emulation (VteTerminal?),
so claiming to support internationalization is disingenuous.


>  - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>    sense now.
>  - Fixed lots of issues raised in review comments (see individual patches)
> 
> Known Issues:
>  - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>    work harder to reproduce.
>  - I've not recreated the reported memory leak yet.
>  - I haven't added backwards compatibility code for older VteTerminal widgets
>    yet.
> 
> 

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (8 preceding siblings ...)
  2012-02-27  7:23 ` [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) malc
@ 2012-02-27  8:21 ` Jan Kiszka
  2012-02-27 13:10   ` Anthony Liguori
  2012-02-27 14:24 ` Kevin Wolf
  2012-03-11 17:29 ` Stefan Weil
  11 siblings, 1 reply; 38+ messages in thread
From: Jan Kiszka @ 2012-02-27  8:21 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

[-- Attachment #1: Type: text/plain, Size: 3300 bytes --]

On 2012-02-27 00:46, Anthony Liguori wrote:
> I realize UIs are the third rail of QEMU development, but over the years I've
> gotten a lot of feedback from users about our UI.  I think everyone struggles
> with the SDL interface and its lack of discoverability but it's worse than I
> think most people realize for users that rely on accessibility tools.
> 
> The two pieces of feedback I've gotten the most re: accessibility are the lack
> of QEMU's enablement for screen readers and the lack of configurable
> accelerators.
> 
> Since we render our own terminal using a fixed sized font, we don't respect
> system font settings which means we ignore if the user has configured large
> print.
> 
> We also don't integrate at all with screen readers which means that for blind
> users, the virtual consoles may as well not even exist.
> 
> We also don't allow any type of configuration of accelerators.  For users with
> limited dexterity (this is actually more common than you would think), they may
> use an input device that only inputs one key at a time.  Holding down two keys
> at once is not possible for these users.
> 
> These are solved problems though and while we could reinvent all of this
> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
> solve these problems.
> 
> By using GTK, we can leverage VteTerminal for screen reader integration and font
> configuration.  We can also use GTK's accelerator support to make accelerators
> configurable (Gnome provides a global accelerator configuration interface).
> 
> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
> there eventually but that's not what this series is about.
> 
> This is just attempting to use a richer toolkit such that we can enable basic
> accessibility support.  As a consequence, the UI is much more usable even for a
> user without accessibility requirements so it's a win-win.
> 
> Also available at:
> 
> https://github.com/aliguori/qemu/tree/gtk.2
> 
> ---
> v1 -> v2
>  - Add internationalization support.  I don't actually speak any other languages
>    so I added a placeholder for a German translation.  This can be tested with
>    LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>  - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>    sense now.
>  - Fixed lots of issues raised in review comments (see individual patches)
> 
> Known Issues:
>  - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>    work harder to reproduce.
>  - I've not recreated the reported memory leak yet.
>  - I haven't added backwards compatibility code for older VteTerminal widgets
>    yet.

Looks quite nice but still has some rough edges:
- full screen doesn't work, at least here
- lacking support for auto-grabbing in absolute mouse mode
- unscaling (ctrl-alt-u) is lacking
- window not resizable (except in broken full-screen mode)

Will see if I find some time to look into this.

Is this also working properly under Windows? Otherwise we probably can't
deprecate SDL - or would have to provide a native Windows GUI.

As we have a menu now, I would suggest to add some handy monitor
commands there as well, like reset or powerdown.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 7/8] gtk: add translation support
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 7/8] gtk: add translation support Anthony Liguori
@ 2012-02-27  8:32   ` Paolo Bonzini
  2012-02-27 13:11     ` Anthony Liguori
  2012-02-28 15:10     ` Kevin Wolf
  2012-02-27 22:09   ` Stefan Weil
  1 sibling, 2 replies; 38+ messages in thread
From: Paolo Bonzini @ 2012-02-27  8:32 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

On 02/27/2012 12:46 AM, Anthony Liguori wrote:
> The de_DE translation is just a placeholder so that I could test the
> infrastructure.

Here is an it_IT translation that you can use instead.

Paolo

[-- Attachment #2: it.po --]
[-- Type: text/x-gettext-translation, Size: 864 bytes --]

# Italian translation for QEMU.
# This file is put in the public domain.
# Paolo Bonzini <pbonzini@redhat.com>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: QEMU 1.0.50\n"
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
"POT-Creation-Date: 2012-02-26 11:30-0600\n"
"PO-Revision-Date: 2012-02-27 08:23+0100\n"
"Last-Translator: Paolo Bonzini <pbonzini@redhat.com>\n"
"Language-Team: Italian <it@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#: ../ui/gtk.c:769
msgid "_File"
msgstr "_File"

#: ../ui/gtk.c:779
msgid "_View"
msgstr "_Visualizza"

#: ../ui/gtk.c:781
msgid "_Full Screen"
msgstr "_Schermo intero"

#: ../ui/gtk.c:805
msgid "_Grab Input"
msgstr "_Cattura input"

#: ../ui/gtk.c:831
msgid "Show _Tabs"
msgstr "Mostra _tab"

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2) Anthony Liguori
@ 2012-02-27 10:45   ` Kevin Wolf
  0 siblings, 0 replies; 38+ messages in thread
From: Kevin Wolf @ 2012-02-27 10:45 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

Am 27.02.2012 00:46, schrieb Anthony Liguori:
> This enables VteTerminal to be used to render the text consoles.  VteTerminal is
> the same widget used by gnome-terminal which means it's VT100 emulation is as
> good as they come.
> 
> It's also screen reader accessible, supports copy/paste, proper scrolling and
> most of the other features you would expect from a terminal widget.
> 
> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ---
> v1 -> v2
>  - make sure to activate the menu item when switching tabs
>  - fix sizing of non-0 pages
> ---
>  console.c |    4 +-
>  console.h |    4 +-
>  ui/gtk.c  |  160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 164 insertions(+), 4 deletions(-)
> 
> diff --git a/console.c b/console.c
> index 6434ed0..c12f02a 100644
> --- a/console.c
> +++ b/console.c
> @@ -1551,9 +1551,9 @@ static CharDriverState *text_console_init(QemuOpts *opts)
>  
>  static VcHandler *vc_handler = text_console_init;
>  
> -int vc_init(QemuOpts *opts, CharDriverState **_chr)
> +CharDriverState *vc_init(QemuOpts *opts)
>  {
> -    return vc_handler(opts, _chr);
> +    return vc_handler(opts);
>  }
>  
>  void register_vc_handler(VcHandler *handler)
> diff --git a/console.h b/console.h
> index 9b4b390..27d7929 100644
> --- a/console.h
> +++ b/console.h
> @@ -363,9 +363,9 @@ void qemu_console_resize(DisplayState *ds, int width, int height);
>  void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
>                         int dst_x, int dst_y, int w, int h);
>  
> -typedef int (VcHandler)(QemuOpts *, CharDriverState **);
> +typedef CharDriverState *(VcHandler)(QemuOpts *);
>  
> -int vc_init(QemuOpts *opts, CharDriverState **_chr);
> +CharDriverState *vc_init(QemuOpts *opts);
>  void register_vc_handler(VcHandler *handler);
>  
>  /* sdl.c */
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 591a987..0579a55 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -56,6 +56,8 @@
>  #define dprintf(fmt, ...) do { } while (0)
>  #endif
>  
> +#define MAX_VCS 10
> +
>  typedef struct VirtualConsole
>  {
>      GtkWidget *menu_item;
> @@ -79,6 +81,9 @@ typedef struct GtkDisplayState
>      GtkWidget *view_menu;
>      GtkWidget *vga_item;
>  
> +    int nb_vcs;
> +    VirtualConsole vc[MAX_VCS];
> +
>      GtkWidget *show_tabs_item;
>  
>      GtkWidget *vbox;
> @@ -400,6 +405,15 @@ static void gd_menu_switch_vc(GtkMenuItem *item, void *opaque)
>  
>      if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->vga_item))) {
>          gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), 0);
> +    } else {
> +        int i;
> +
> +        for (i = 0; i < s->nb_vcs; i++) {
> +            if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->vc[i].menu_item))) {
> +                gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), i + 1);
> +                break;
> +            }
> +        }
>      }
>  }
>  
> @@ -418,16 +432,154 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
>                             gpointer data)
>  {
>      GtkDisplayState *s = data;
> +    guint last_page;
>  
>      if (!gtk_widget_get_realized(s->notebook)) {
>          return;
>      }
>  
> +    last_page = gtk_notebook_get_current_page(nb);
> +
> +    if (last_page) {
> +        gtk_widget_set_size_request(s->vc[last_page - 1].terminal, -1, -1);
> +    }
> +
> +    if (arg2 == 0) {
> +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->vga_item), TRUE);
> +    } else {
> +        VirtualConsole *vc = &s->vc[arg2 - 1];
> +        VteTerminal *term = VTE_TERMINAL(vc->terminal);
> +        int width, height;
> +
> +        width = 80 * vte_terminal_get_char_width(term);
> +        height = 25 * vte_terminal_get_char_height(term);
> +
> +        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE);
> +        gtk_widget_set_size_request(vc->terminal, width, height);
> +    }        
> +
>      gd_update_cursor(s, TRUE);
>  }
>  
> +/** Virtual Console Callbacks **/
> +
> +static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
> +{
> +    VirtualConsole *vc = chr->opaque;
> +
> +    return write(vc->fd, buf, len);
> +}
> +
> +static int nb_vcs;
> +static CharDriverState *vcs[MAX_VCS];
> +
> +static CharDriverState *gd_vc_handler(QemuOpts *opts)
> +{
> +    CharDriverState *chr;
> +
> +    chr = g_malloc0(sizeof(*chr));
> +    chr->chr_write = gd_vc_chr_write;
> +
> +    vcs[nb_vcs++] = chr;
> +
> +    return chr;
> +}
> +
>  void early_gtk_display_init(void)
>  {
> +    register_vc_handler(gd_vc_handler);
> +}
> +
> +static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque)
> +{
> +    VirtualConsole *vc = opaque;
> +    uint8_t buffer[1024];
> +    ssize_t len;
> +
> +    len = read(vc->fd, buffer, sizeof(buffer));
> +    if (len <= 0) {
> +        return FALSE;
> +    }
> +
> +    qemu_chr_be_write(vc->chr, buffer, len);
> +
> +    return TRUE;
> +}
> +
> +static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSList *group)
> +{
> +    const char *label;
> +    char buffer[32];
> +    char path[32];
> +    VtePty *pty;
> +    GIOChannel *chan;
> +    GtkWidget *scrolled_window;
> +    GtkAdjustment *hadjustment, *vadjustment;

Doesn't build without modifications:

ui/gtk.c: In function 'gd_vc_init':
ui/gtk.c:661:20: error: variable 'hadjustment' set but not used
[-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Kevin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27  8:21 ` Jan Kiszka
@ 2012-02-27 13:10   ` Anthony Liguori
  2012-02-27 13:26     ` Jan Kiszka
  0 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 13:10 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Kevin Wolf, Stefan Weil, Alex Graf, qemu-devel, Paolo Bonzini

On 02/27/2012 02:21 AM, Jan Kiszka wrote:
> On 2012-02-27 00:46, Anthony Liguori wrote:
>> I realize UIs are the third rail of QEMU development, but over the years I've
>> gotten a lot of feedback from users about our UI.  I think everyone struggles
>> with the SDL interface and its lack of discoverability but it's worse than I
>> think most people realize for users that rely on accessibility tools.
>>
>> The two pieces of feedback I've gotten the most re: accessibility are the lack
>> of QEMU's enablement for screen readers and the lack of configurable
>> accelerators.
>>
>> Since we render our own terminal using a fixed sized font, we don't respect
>> system font settings which means we ignore if the user has configured large
>> print.
>>
>> We also don't integrate at all with screen readers which means that for blind
>> users, the virtual consoles may as well not even exist.
>>
>> We also don't allow any type of configuration of accelerators.  For users with
>> limited dexterity (this is actually more common than you would think), they may
>> use an input device that only inputs one key at a time.  Holding down two keys
>> at once is not possible for these users.
>>
>> These are solved problems though and while we could reinvent all of this
>> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
>> solve these problems.
>>
>> By using GTK, we can leverage VteTerminal for screen reader integration and font
>> configuration.  We can also use GTK's accelerator support to make accelerators
>> configurable (Gnome provides a global accelerator configuration interface).
>>
>> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
>> there eventually but that's not what this series is about.
>>
>> This is just attempting to use a richer toolkit such that we can enable basic
>> accessibility support.  As a consequence, the UI is much more usable even for a
>> user without accessibility requirements so it's a win-win.
>>
>> Also available at:
>>
>> https://github.com/aliguori/qemu/tree/gtk.2
>>
>> ---
>> v1 ->  v2
>>   - Add internationalization support.  I don't actually speak any other languages
>>     so I added a placeholder for a German translation.  This can be tested with
>>     LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>>   - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>>     sense now.
>>   - Fixed lots of issues raised in review comments (see individual patches)
>>
>> Known Issues:
>>   - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>>     work harder to reproduce.
>>   - I've not recreated the reported memory leak yet.
>>   - I haven't added backwards compatibility code for older VteTerminal widgets
>>     yet.
>
> Looks quite nice but still has some rough edges:
> - full screen doesn't work, at least here

How does it fail?  It works for me.  What distro are you on?

> - lacking support for auto-grabbing in absolute mouse mode

What do you mean by auto grabbing?

> - unscaling (ctrl-alt-u) is lacking

Since we scale by 25% up and down, I figured it wasn't strictly necessary 
anymore because it's very easy to zoom back to the original size.  It's easy 
enough to add though.

> - window not resizable (except in broken full-screen mode)

That's intentional.

>
> Will see if I find some time to look into this.
>
> Is this also working properly under Windows? Otherwise we probably can't
> deprecate SDL - or would have to provide a native Windows GUI.

It should, but it doesn't right now most likely because of the glib event loop 
being broken on win32.

> As we have a menu now, I would suggest to add some handy monitor
> commands there as well, like reset or powerdown.

Absolutely.  I wanted to start with something very simple though first.

Regards,

Anthony Liguori

> Jan
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 7/8] gtk: add translation support
  2012-02-27  8:32   ` Paolo Bonzini
@ 2012-02-27 13:11     ` Anthony Liguori
  2012-02-28 15:10     ` Kevin Wolf
  1 sibling, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 13:11 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 02/27/2012 02:32 AM, Paolo Bonzini wrote:
> On 02/27/2012 12:46 AM, Anthony Liguori wrote:
>> The de_DE translation is just a placeholder so that I could test the
>> infrastructure.
>
> Here is an it_IT translation that you can use instead.

Grazie!

Regards,

Anthony Liguori

>
> Paolo

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:10   ` Anthony Liguori
@ 2012-02-27 13:26     ` Jan Kiszka
  2012-02-27 13:33       ` Anthony Liguori
  0 siblings, 1 reply; 38+ messages in thread
From: Jan Kiszka @ 2012-02-27 13:26 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefano Stabellini, Stefan Weil, Alex Graf,
	qemu-devel, Paolo Bonzini

On 2012-02-27 14:10, Anthony Liguori wrote:
> On 02/27/2012 02:21 AM, Jan Kiszka wrote:
>> On 2012-02-27 00:46, Anthony Liguori wrote:
>>> I realize UIs are the third rail of QEMU development, but over the
>>> years I've
>>> gotten a lot of feedback from users about our UI.  I think everyone
>>> struggles
>>> with the SDL interface and its lack of discoverability but it's worse
>>> than I
>>> think most people realize for users that rely on accessibility tools.
>>>
>>> The two pieces of feedback I've gotten the most re: accessibility are
>>> the lack
>>> of QEMU's enablement for screen readers and the lack of configurable
>>> accelerators.
>>>
>>> Since we render our own terminal using a fixed sized font, we don't
>>> respect
>>> system font settings which means we ignore if the user has configured
>>> large
>>> print.
>>>
>>> We also don't integrate at all with screen readers which means that
>>> for blind
>>> users, the virtual consoles may as well not even exist.
>>>
>>> We also don't allow any type of configuration of accelerators.  For
>>> users with
>>> limited dexterity (this is actually more common than you would
>>> think), they may
>>> use an input device that only inputs one key at a time.  Holding down
>>> two keys
>>> at once is not possible for these users.
>>>
>>> These are solved problems though and while we could reinvent all of this
>>> ourselves with SDL, we would be crazy if we did.  Modern toolkits,
>>> like GTK,
>>> solve these problems.
>>>
>>> By using GTK, we can leverage VteTerminal for screen reader
>>> integration and font
>>> configuration.  We can also use GTK's accelerator support to make
>>> accelerators
>>> configurable (Gnome provides a global accelerator configuration
>>> interface).
>>>
>>> I'm not attempting to make a pretty desktop virtualization UI.  Maybe
>>> we'll go
>>> there eventually but that's not what this series is about.
>>>
>>> This is just attempting to use a richer toolkit such that we can
>>> enable basic
>>> accessibility support.  As a consequence, the UI is much more usable
>>> even for a
>>> user without accessibility requirements so it's a win-win.
>>>
>>> Also available at:
>>>
>>> https://github.com/aliguori/qemu/tree/gtk.2
>>>
>>> ---
>>> v1 ->  v2
>>>   - Add internationalization support.  I don't actually speak any
>>> other languages
>>>     so I added a placeholder for a German translation.  This can be
>>> tested with
>>>     LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>>>   - Fixed the terminal size for VteTerminal widgets.  I think the
>>> behavior makes
>>>     sense now.
>>>   - Fixed lots of issues raised in review comments (see individual
>>> patches)
>>>
>>> Known Issues:
>>>   - I saw the X crash once.  I think it has to do with widget sizes. 
>>> I need to
>>>     work harder to reproduce.
>>>   - I've not recreated the reported memory leak yet.
>>>   - I haven't added backwards compatibility code for older
>>> VteTerminal widgets
>>>     yet.
>>
>> Looks quite nice but still has some rough edges:
>> - full screen doesn't work, at least here
> 
> How does it fail? 

The window changes to resizable mode, but remains a decorated window.

> It works for me.  What distro are you on?

OpenSUSE 11.4, gnome2.

> 
>> - lacking support for auto-grabbing in absolute mouse mode
> 
> What do you mean by auto grabbing?

That all keyboard inputs are grabbed when the mouse is in the window and
you don't need to press ctrl-alt-g explicitly. And the reverse should
happen when the mouse reaches the window border. Just like under SDL,
give it a try.

> 
>> - unscaling (ctrl-alt-u) is lacking
> 
> Since we scale by 25% up and down, I figured it wasn't strictly
> necessary anymore because it's very easy to zoom back to the original
> size.  It's easy enough to add though.

It's mandatory for usability IMHO. You find this "back to 1:1 view" in
almost every application that supports scaling of its view, and we even
have a pre-defined shortcut for it for some releases now.

> 
>> - window not resizable (except in broken full-screen mode)
> 
> That's intentional.

And a mistake IMHO. Definitely for the text consoles, but one can also
argue about the guest graphic console. I think Stefano once introduced
this for some Xen use case, maybe he can comment on it.

BTW, "VGA" is the wrong term for the graphic console. Maybe there is the
real front-end name available somewhere and could be used instead.

> 
>>
>> Will see if I find some time to look into this.
>>
>> Is this also working properly under Windows? Otherwise we probably can't
>> deprecate SDL - or would have to provide a native Windows GUI.
> 
> It should, but it doesn't right now most likely because of the glib
> event loop being broken on win32.

Sounds great.

> 
>> As we have a menu now, I would suggest to add some handy monitor
>> commands there as well, like reset or powerdown.
> 
> Absolutely.  I wanted to start with something very simple though first.
> 
> Regards,
> 
> Anthony Liguori
> 
>> Jan
>>
> 

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:26     ` Jan Kiszka
@ 2012-02-27 13:33       ` Anthony Liguori
  2012-02-27 13:42         ` Jan Kiszka
  2012-02-27 16:39         ` Gerd Hoffmann
  0 siblings, 2 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 13:33 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Kevin Wolf, Stefano Stabellini, Stefan Weil, Alex Graf,
	qemu-devel, Paolo Bonzini

On 02/27/2012 07:26 AM, Jan Kiszka wrote:
> On 2012-02-27 14:10, Anthony Liguori wrote:
>> On 02/27/2012 02:21 AM, Jan Kiszka wrote:
>>> On 2012-02-27 00:46, Anthony Liguori wrote:
>>>> I realize UIs are the third rail of QEMU development, but over the
>>>> years I've
>>>> gotten a lot of feedback from users about our UI.  I think everyone
>>>> struggles
>>>> with the SDL interface and its lack of discoverability but it's worse
>>>> than I
>>>> think most people realize for users that rely on accessibility tools.
>>>>
>>>> The two pieces of feedback I've gotten the most re: accessibility are
>>>> the lack
>>>> of QEMU's enablement for screen readers and the lack of configurable
>>>> accelerators.
>>>>
>>>> Since we render our own terminal using a fixed sized font, we don't
>>>> respect
>>>> system font settings which means we ignore if the user has configured
>>>> large
>>>> print.
>>>>
>>>> We also don't integrate at all with screen readers which means that
>>>> for blind
>>>> users, the virtual consoles may as well not even exist.
>>>>
>>>> We also don't allow any type of configuration of accelerators.  For
>>>> users with
>>>> limited dexterity (this is actually more common than you would
>>>> think), they may
>>>> use an input device that only inputs one key at a time.  Holding down
>>>> two keys
>>>> at once is not possible for these users.
>>>>
>>>> These are solved problems though and while we could reinvent all of this
>>>> ourselves with SDL, we would be crazy if we did.  Modern toolkits,
>>>> like GTK,
>>>> solve these problems.
>>>>
>>>> By using GTK, we can leverage VteTerminal for screen reader
>>>> integration and font
>>>> configuration.  We can also use GTK's accelerator support to make
>>>> accelerators
>>>> configurable (Gnome provides a global accelerator configuration
>>>> interface).
>>>>
>>>> I'm not attempting to make a pretty desktop virtualization UI.  Maybe
>>>> we'll go
>>>> there eventually but that's not what this series is about.
>>>>
>>>> This is just attempting to use a richer toolkit such that we can
>>>> enable basic
>>>> accessibility support.  As a consequence, the UI is much more usable
>>>> even for a
>>>> user without accessibility requirements so it's a win-win.
>>>>
>>>> Also available at:
>>>>
>>>> https://github.com/aliguori/qemu/tree/gtk.2
>>>>
>>>> ---
>>>> v1 ->   v2
>>>>    - Add internationalization support.  I don't actually speak any
>>>> other languages
>>>>      so I added a placeholder for a German translation.  This can be
>>>> tested with
>>>>      LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>>>>    - Fixed the terminal size for VteTerminal widgets.  I think the
>>>> behavior makes
>>>>      sense now.
>>>>    - Fixed lots of issues raised in review comments (see individual
>>>> patches)
>>>>
>>>> Known Issues:
>>>>    - I saw the X crash once.  I think it has to do with widget sizes.
>>>> I need to
>>>>      work harder to reproduce.
>>>>    - I've not recreated the reported memory leak yet.
>>>>    - I haven't added backwards compatibility code for older
>>>> VteTerminal widgets
>>>>      yet.
>>>
>>> Looks quite nice but still has some rough edges:
>>> - full screen doesn't work, at least here
>>
>> How does it fail?
>
> The window changes to resizable mode, but remains a decorated window.
>
>> It works for me.  What distro are you on?
>
> OpenSUSE 11.4, gnome2.

Okay, I'll setup a system and test it out.

>>> - lacking support for auto-grabbing in absolute mouse mode
>>
>> What do you mean by auto grabbing?
>
> That all keyboard inputs are grabbed when the mouse is in the window and
> you don't need to press ctrl-alt-g explicitly. And the reverse should
> happen when the mouse reaches the window border. Just like under SDL,
> give it a try.

Right, this was intentional.  I think it's weird that a window would steal input 
when the mouse moves over it breaking desktop accelerators like alt tab.  If 
you've ever alt-tab cycled through windows when QEMU is running, if you're 
unlucky enough to have the mouse where a QEMU window may be, the QEMU instance 
will steal input and prevent alt-tab from working anymore.

>>> - unscaling (ctrl-alt-u) is lacking
>>
>> Since we scale by 25% up and down, I figured it wasn't strictly
>> necessary anymore because it's very easy to zoom back to the original
>> size.  It's easy enough to add though.
>
> It's mandatory for usability IMHO. You find this "back to 1:1 view" in
> almost every application that supports scaling of its view, and we even
> have a pre-defined shortcut for it for some releases now.

I'll add it.

>>> - window not resizable (except in broken full-screen mode)
>>
>> That's intentional.
>
> And a mistake IMHO. Definitely for the text consoles, but one can also
> argue about the guest graphic console. I think Stefano once introduced
> this for some Xen use case, maybe he can comment on it.

If we added resize, I wouldn't want to scale-to-size.  I find this behavior to 
be more trouble than it's worth.  I'd want to render the VGA screen with a black 
border only scaling based on the zoom settings.

> BTW, "VGA" is the wrong term for the graphic console. Maybe there is the
> real front-end name available somewhere and could be used instead.

Any suggestions?  Display?  Graphics?

Or were you thinking something like Cirrus VGA?

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:33       ` Anthony Liguori
@ 2012-02-27 13:42         ` Jan Kiszka
  2012-02-27 13:50           ` Anthony Liguori
  2012-02-27 16:39         ` Gerd Hoffmann
  1 sibling, 1 reply; 38+ messages in thread
From: Jan Kiszka @ 2012-02-27 13:42 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefano Stabellini, Stefan Weil, Alex Graf,
	qemu-devel, Paolo Bonzini

On 2012-02-27 14:33, Anthony Liguori wrote:
>> That all keyboard inputs are grabbed when the mouse is in the window and
>> you don't need to press ctrl-alt-g explicitly. And the reverse should
>> happen when the mouse reaches the window border. Just like under SDL,
>> give it a try.
> 
> Right, this was intentional.  I think it's weird that a window would steal input 
> when the mouse moves over it breaking desktop accelerators like alt tab.  If 
> you've ever alt-tab cycled through windows when QEMU is running, if you're 
> unlucky enough to have the mouse where a QEMU window may be, the QEMU instance 
> will steal input and prevent alt-tab from working anymore.

This would be a usability regression. It is very unhandy to switch
between grabbed and ungrabbed, specifically for alt-tab, when working
with guests vs. host windows. Look e.g. at how rdeskop works in this
regard. That's why I introduced this feature to QEMU, and I would not
want to see it die again with the introduction of GTK.

>>>> - window not resizable (except in broken full-screen mode)
>>>
>>> That's intentional.
>>
>> And a mistake IMHO. Definitely for the text consoles, but one can also
>> argue about the guest graphic console. I think Stefano once introduced
>> this for some Xen use case, maybe he can comment on it.
> 
> If we added resize, I wouldn't want to scale-to-size.  I find this behavior to 
> be more trouble than it's worth.  I'd want to render the VGA screen with a black 
> border only scaling based on the zoom settings.

OK for aspect-ratio-correct scaling of the guest view from my POV. And
if there is a use case for the old behavior, we could still add a switch
to the menu for selecting the scaling mode.

> 
>> BTW, "VGA" is the wrong term for the graphic console. Maybe there is the
>> real front-end name available somewhere and could be used instead.
> 
> Any suggestions?  Display?  Graphics?
> 
> Or were you thinking something like Cirrus VGA?

VGA is (mostly) x86. Also, we may once have multiple guest screens,
maybe even multiple types of them. So picking up some telling front-end
name would likely scale best.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:42         ` Jan Kiszka
@ 2012-02-27 13:50           ` Anthony Liguori
  2012-02-27 13:54             ` Jan Kiszka
  0 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 13:50 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Kevin Wolf, Stefano Stabellini, Stefan Weil, qemu-devel,
	Alex Graf, Paolo Bonzini

On 02/27/2012 07:42 AM, Jan Kiszka wrote:
> On 2012-02-27 14:33, Anthony Liguori wrote:
>>> That all keyboard inputs are grabbed when the mouse is in the window and
>>> you don't need to press ctrl-alt-g explicitly. And the reverse should
>>> happen when the mouse reaches the window border. Just like under SDL,
>>> give it a try.
>>
>> Right, this was intentional.  I think it's weird that a window would steal input
>> when the mouse moves over it breaking desktop accelerators like alt tab.  If
>> you've ever alt-tab cycled through windows when QEMU is running, if you're
>> unlucky enough to have the mouse where a QEMU window may be, the QEMU instance
>> will steal input and prevent alt-tab from working anymore.
>
> This would be a usability regression. It is very unhandy to switch
> between grabbed and ungrabbed, specifically for alt-tab, when working
> with guests vs. host windows. Look e.g. at how rdeskop works in this
> regard. That's why I introduced this feature to QEMU, and I would not
> want to see it die again with the introduction of GTK.

I'll add a "Grab on Hover" menu item to enable the behavior.  It's a good excuse 
to look at gconf to store GUI preferences too.

>>>>> - window not resizable (except in broken full-screen mode)
>>>>
>>>> That's intentional.
>>>
>>> And a mistake IMHO. Definitely for the text consoles, but one can also
>>> argue about the guest graphic console. I think Stefano once introduced
>>> this for some Xen use case, maybe he can comment on it.
>>
>> If we added resize, I wouldn't want to scale-to-size.  I find this behavior to
>> be more trouble than it's worth.  I'd want to render the VGA screen with a black
>> border only scaling based on the zoom settings.
>
> OK for aspect-ratio-correct scaling of the guest view from my POV. And
> if there is a use case for the old behavior, we could still add a switch
> to the menu for selecting the scaling mode.

Okay, I'll look into it.

>>> BTW, "VGA" is the wrong term for the graphic console. Maybe there is the
>>> real front-end name available somewhere and could be used instead.
>>
>> Any suggestions?  Display?  Graphics?
>>
>> Or were you thinking something like Cirrus VGA?
>
> VGA is (mostly) x86. Also, we may once have multiple guest screens,
> maybe even multiple types of them. So picking up some telling front-end
> name would likely scale best.

Display 0?

I think Monitor would be more natural but obviously that would conflict with the 
human monitor.

Regards,

Anthony Liguori

> Jan
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:50           ` Anthony Liguori
@ 2012-02-27 13:54             ` Jan Kiszka
  0 siblings, 0 replies; 38+ messages in thread
From: Jan Kiszka @ 2012-02-27 13:54 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefano Stabellini, Stefan Weil, qemu-devel,
	Alex Graf, Paolo Bonzini

On 2012-02-27 14:50, Anthony Liguori wrote:
> On 02/27/2012 07:42 AM, Jan Kiszka wrote:
>> On 2012-02-27 14:33, Anthony Liguori wrote:
>>>> That all keyboard inputs are grabbed when the mouse is in the window and
>>>> you don't need to press ctrl-alt-g explicitly. And the reverse should
>>>> happen when the mouse reaches the window border. Just like under SDL,
>>>> give it a try.
>>>
>>> Right, this was intentional.  I think it's weird that a window would steal input
>>> when the mouse moves over it breaking desktop accelerators like alt tab.  If
>>> you've ever alt-tab cycled through windows when QEMU is running, if you're
>>> unlucky enough to have the mouse where a QEMU window may be, the QEMU instance
>>> will steal input and prevent alt-tab from working anymore.
>>
>> This would be a usability regression. It is very unhandy to switch
>> between grabbed and ungrabbed, specifically for alt-tab, when working
>> with guests vs. host windows. Look e.g. at how rdeskop works in this
>> regard. That's why I introduced this feature to QEMU, and I would not
>> want to see it die again with the introduction of GTK.
> 
> I'll add a "Grab on Hover" menu item to enable the behavior.  It's a good excuse 
> to look at gconf to store GUI preferences too.

Perfect.

> 
>>>>>> - window not resizable (except in broken full-screen mode)
>>>>>
>>>>> That's intentional.
>>>>
>>>> And a mistake IMHO. Definitely for the text consoles, but one can also
>>>> argue about the guest graphic console. I think Stefano once introduced
>>>> this for some Xen use case, maybe he can comment on it.
>>>
>>> If we added resize, I wouldn't want to scale-to-size.  I find this behavior to
>>> be more trouble than it's worth.  I'd want to render the VGA screen with a black
>>> border only scaling based on the zoom settings.
>>
>> OK for aspect-ratio-correct scaling of the guest view from my POV. And
>> if there is a use case for the old behavior, we could still add a switch
>> to the menu for selecting the scaling mode.
> 
> Okay, I'll look into it.
> 
>>>> BTW, "VGA" is the wrong term for the graphic console. Maybe there is the
>>>> real front-end name available somewhere and could be used instead.
>>>
>>> Any suggestions?  Display?  Graphics?
>>>
>>> Or were you thinking something like Cirrus VGA?
>>
>> VGA is (mostly) x86. Also, we may once have multiple guest screens,
>> maybe even multiple types of them. So picking up some telling front-end
>> name would likely scale best.
> 
> Display 0?
> 
> I think Monitor would be more natural but obviously that would conflict with the 
> human monitor.

It might also be something else than a "monitor" that visualizes guest
graphic-like output.

Another effect I just noticed: The scroll position of the monitor
console is not always properly restored when switching from other
consoles. Looks like it can move down, leaving the visible range after
some switches.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (9 preceding siblings ...)
  2012-02-27  8:21 ` Jan Kiszka
@ 2012-02-27 14:24 ` Kevin Wolf
  2012-02-27 14:39   ` Anthony Liguori
  2012-03-11 17:29 ` Stefan Weil
  11 siblings, 1 reply; 38+ messages in thread
From: Kevin Wolf @ 2012-02-27 14:24 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

Am 27.02.2012 00:46, schrieb Anthony Liguori:
> I realize UIs are the third rail of QEMU development, but over the years I've
> gotten a lot of feedback from users about our UI.  I think everyone struggles
> with the SDL interface and its lack of discoverability but it's worse than I
> think most people realize for users that rely on accessibility tools.
> 
> The two pieces of feedback I've gotten the most re: accessibility are the lack
> of QEMU's enablement for screen readers and the lack of configurable
> accelerators.
> 
> Since we render our own terminal using a fixed sized font, we don't respect
> system font settings which means we ignore if the user has configured large
> print.
> 
> We also don't integrate at all with screen readers which means that for blind
> users, the virtual consoles may as well not even exist.
> 
> We also don't allow any type of configuration of accelerators.  For users with
> limited dexterity (this is actually more common than you would think), they may
> use an input device that only inputs one key at a time.  Holding down two keys
> at once is not possible for these users.
> 
> These are solved problems though and while we could reinvent all of this
> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
> solve these problems.
> 
> By using GTK, we can leverage VteTerminal for screen reader integration and font
> configuration.  We can also use GTK's accelerator support to make accelerators
> configurable (Gnome provides a global accelerator configuration interface).
> 
> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
> there eventually but that's not what this series is about.
> 
> This is just attempting to use a richer toolkit such that we can enable basic
> accessibility support.  As a consequence, the UI is much more usable even for a
> user without accessibility requirements so it's a win-win.
> 
> Also available at:
> 
> https://github.com/aliguori/qemu/tree/gtk.2
> 
> ---
> v1 -> v2
>  - Add internationalization support.  I don't actually speak any other languages
>    so I added a placeholder for a German translation.  This can be tested with
>    LANGUAGE=de_DE.UTF-8 qemu-system-x86_64

Looks like I need to 'make install' before I can use the translations? I
don't have any qemu version installed into the system, but always run it
from to build directory (I would only confuse the different trees if
something was installed). Shouldn't it be possible that qemu finds the
right files just like it does with the BIOS etc.?

>  - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>    sense now.
>  - Fixed lots of issues raised in review comments (see individual patches)
> 
> Known Issues:
>  - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>    work harder to reproduce.
>  - I've not recreated the reported memory leak yet.
>  - I haven't added backwards compatibility code for older VteTerminal widgets
>    yet.

- F10 still activates the menu (same for Alt-F/V)

Kevin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 14:24 ` Kevin Wolf
@ 2012-02-27 14:39   ` Anthony Liguori
  2012-02-27 15:03     ` Kevin Wolf
  0 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 14:39 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

On 02/27/2012 08:24 AM, Kevin Wolf wrote:
> Am 27.02.2012 00:46, schrieb Anthony Liguori:
>> I realize UIs are the third rail of QEMU development, but over the years I've
>> gotten a lot of feedback from users about our UI.  I think everyone struggles
>> with the SDL interface and its lack of discoverability but it's worse than I
>> think most people realize for users that rely on accessibility tools.
>>
>> The two pieces of feedback I've gotten the most re: accessibility are the lack
>> of QEMU's enablement for screen readers and the lack of configurable
>> accelerators.
>>
>> Since we render our own terminal using a fixed sized font, we don't respect
>> system font settings which means we ignore if the user has configured large
>> print.
>>
>> We also don't integrate at all with screen readers which means that for blind
>> users, the virtual consoles may as well not even exist.
>>
>> We also don't allow any type of configuration of accelerators.  For users with
>> limited dexterity (this is actually more common than you would think), they may
>> use an input device that only inputs one key at a time.  Holding down two keys
>> at once is not possible for these users.
>>
>> These are solved problems though and while we could reinvent all of this
>> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
>> solve these problems.
>>
>> By using GTK, we can leverage VteTerminal for screen reader integration and font
>> configuration.  We can also use GTK's accelerator support to make accelerators
>> configurable (Gnome provides a global accelerator configuration interface).
>>
>> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
>> there eventually but that's not what this series is about.
>>
>> This is just attempting to use a richer toolkit such that we can enable basic
>> accessibility support.  As a consequence, the UI is much more usable even for a
>> user without accessibility requirements so it's a win-win.
>>
>> Also available at:
>>
>> https://github.com/aliguori/qemu/tree/gtk.2
>>
>> ---
>> v1 ->  v2
>>   - Add internationalization support.  I don't actually speak any other languages
>>     so I added a placeholder for a German translation.  This can be tested with
>>     LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>
> Looks like I need to 'make install' before I can use the translations? I
> don't have any qemu version installed into the system, but always run it
> from to build directory (I would only confuse the different trees if
> something was installed). Shouldn't it be possible that qemu finds the
> right files just like it does with the BIOS etc.?

It's a little harder because of the way gettext works.  You can only have a 
single search path AFAICT.

We could add a --with-localedir= to configure and then rearrange the po/ 
structure.  Then you would do something like:

./configure --with-localedir=$(pwd)/po

And it would use translations from your build directory.

>>   - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>>     sense now.
>>   - Fixed lots of issues raised in review comments (see individual patches)
>>
>> Known Issues:
>>   - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>>     work harder to reproduce.
>>   - I've not recreated the reported memory leak yet.
>>   - I haven't added backwards compatibility code for older VteTerminal widgets
>>     yet.
>
> - F10 still activates the menu (same for Alt-F/V)

This is expected behavior although Grab on Hover will cause it to behave like 
SDL does.

F10/Alt-F/V are menu accelerators and we need to allow menu accelerators for 
things like Ctrl-Alt-2 to work.

More importantly, it should be possible to navigate the GUI without a mouse 
(this is an accessibility requirement).  Without supporting Alt-F, there's no 
way to navigate the menu from the keyboard.

That said, we probably do want to add a Send Key menu for sending key sequences 
that are used as accelerators.

Regards,

Anthony Liguo

>
> Kevin
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 14:39   ` Anthony Liguori
@ 2012-02-27 15:03     ` Kevin Wolf
  0 siblings, 0 replies; 38+ messages in thread
From: Kevin Wolf @ 2012-02-27 15:03 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Stefan Weil, Paolo Bonzini, qemu-devel, Alex Graf

Am 27.02.2012 15:39, schrieb Anthony Liguori:
> On 02/27/2012 08:24 AM, Kevin Wolf wrote:
>> Am 27.02.2012 00:46, schrieb Anthony Liguori:
>>> I realize UIs are the third rail of QEMU development, but over the years I've
>>> gotten a lot of feedback from users about our UI.  I think everyone struggles
>>> with the SDL interface and its lack of discoverability but it's worse than I
>>> think most people realize for users that rely on accessibility tools.
>>>
>>> The two pieces of feedback I've gotten the most re: accessibility are the lack
>>> of QEMU's enablement for screen readers and the lack of configurable
>>> accelerators.
>>>
>>> Since we render our own terminal using a fixed sized font, we don't respect
>>> system font settings which means we ignore if the user has configured large
>>> print.
>>>
>>> We also don't integrate at all with screen readers which means that for blind
>>> users, the virtual consoles may as well not even exist.
>>>
>>> We also don't allow any type of configuration of accelerators.  For users with
>>> limited dexterity (this is actually more common than you would think), they may
>>> use an input device that only inputs one key at a time.  Holding down two keys
>>> at once is not possible for these users.
>>>
>>> These are solved problems though and while we could reinvent all of this
>>> ourselves with SDL, we would be crazy if we did.  Modern toolkits, like GTK,
>>> solve these problems.
>>>
>>> By using GTK, we can leverage VteTerminal for screen reader integration and font
>>> configuration.  We can also use GTK's accelerator support to make accelerators
>>> configurable (Gnome provides a global accelerator configuration interface).
>>>
>>> I'm not attempting to make a pretty desktop virtualization UI.  Maybe we'll go
>>> there eventually but that's not what this series is about.
>>>
>>> This is just attempting to use a richer toolkit such that we can enable basic
>>> accessibility support.  As a consequence, the UI is much more usable even for a
>>> user without accessibility requirements so it's a win-win.
>>>
>>> Also available at:
>>>
>>> https://github.com/aliguori/qemu/tree/gtk.2
>>>
>>> ---
>>> v1 ->  v2
>>>   - Add internationalization support.  I don't actually speak any other languages
>>>     so I added a placeholder for a German translation.  This can be tested with
>>>     LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
>>
>> Looks like I need to 'make install' before I can use the translations? I
>> don't have any qemu version installed into the system, but always run it
>> from to build directory (I would only confuse the different trees if
>> something was installed). Shouldn't it be possible that qemu finds the
>> right files just like it does with the BIOS etc.?
> 
> It's a little harder because of the way gettext works.  You can only have a 
> single search path AFAICT.
> 
> We could add a --with-localedir= to configure and then rearrange the po/ 
> structure.  Then you would do something like:
> 
> ./configure --with-localedir=$(pwd)/po
> 
> And it would use translations from your build directory.

Yeah, would be better than nothing.

>>>   - Fixed the terminal size for VteTerminal widgets.  I think the behavior makes
>>>     sense now.
>>>   - Fixed lots of issues raised in review comments (see individual patches)
>>>
>>> Known Issues:
>>>   - I saw the X crash once.  I think it has to do with widget sizes.  I need to
>>>     work harder to reproduce.
>>>   - I've not recreated the reported memory leak yet.
>>>   - I haven't added backwards compatibility code for older VteTerminal widgets
>>>     yet.
>>
>> - F10 still activates the menu (same for Alt-F/V)
> 
> This is expected behavior although Grab on Hover will cause it to behave like 
> SDL does.

At least grabbing the keyboard manually with Ctrl-Alt-G doesn't disable
the accelerators, so even then you can't use these keys inside the VM.

> F10/Alt-F/V are menu accelerators and we need to allow menu accelerators for 
> things like Ctrl-Alt-2 to work.
> 
> More importantly, it should be possible to navigate the GUI without a mouse 
> (this is an accessibility requirement).  Without supporting Alt-F, there's no 
> way to navigate the menu from the keyboard.
> 
> That said, we probably do want to add a Send Key menu for sending key sequences 
> that are used as accelerators.

Probably. But not for things as common as Alt-F, Alt-V or F10. Having to
use sendkey or the menus for these would be ridiculous and make SDL the
friendlier user interface again.

Can accelerators only be enabled or disabled all at once? Or could we
say that we disable everything that doesn't include Ctrl-Alt and provide
an alternative accelerator for activating the menu, like Ctrl_Alt-M?

Kevin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 13:33       ` Anthony Liguori
  2012-02-27 13:42         ` Jan Kiszka
@ 2012-02-27 16:39         ` Gerd Hoffmann
  2012-02-27 16:44           ` Anthony Liguori
  1 sibling, 1 reply; 38+ messages in thread
From: Gerd Hoffmann @ 2012-02-27 16:39 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefano Stabellini, Jan Kiszka, qemu-devel,
	Alex Graf, Stefan Weil, Paolo Bonzini

  Hi,

>> That all keyboard inputs are grabbed when the mouse is in the window and
>> you don't need to press ctrl-alt-g explicitly. And the reverse should
>> happen when the mouse reaches the window border. Just like under SDL,
>> give it a try.
> 
> Right, this was intentional.  I think it's weird that a window would
> steal input when the mouse moves over it breaking desktop accelerators
> like alt tab.  If you've ever alt-tab cycled through windows when QEMU
> is running, if you're unlucky enough to have the mouse where a QEMU
> window may be, the QEMU instance will steal input and prevent alt-tab
> from working anymore.

Same is true the other way around.  Working in the guest, then have the
host desktop grab accelerators can be annoying too.  You might have
wanted switch *guest* windows with alt tab ;)

It is a tricky usability issue.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 16:39         ` Gerd Hoffmann
@ 2012-02-27 16:44           ` Anthony Liguori
  2012-02-27 16:54             ` Gerd Hoffmann
  0 siblings, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 16:44 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Kevin Wolf, Stefano Stabellini, Jan Kiszka, qemu-devel,
	Alex Graf, Stefan Weil, Paolo Bonzini

On 02/27/2012 10:39 AM, Gerd Hoffmann wrote:
>    Hi,
>
>>> That all keyboard inputs are grabbed when the mouse is in the window and
>>> you don't need to press ctrl-alt-g explicitly. And the reverse should
>>> happen when the mouse reaches the window border. Just like under SDL,
>>> give it a try.
>>
>> Right, this was intentional.  I think it's weird that a window would
>> steal input when the mouse moves over it breaking desktop accelerators
>> like alt tab.  If you've ever alt-tab cycled through windows when QEMU
>> is running, if you're unlucky enough to have the mouse where a QEMU
>> window may be, the QEMU instance will steal input and prevent alt-tab
>> from working anymore.
>
> Same is true the other way around.  Working in the guest, then have the
> host desktop grab accelerators can be annoying too.  You might have
> wanted switch *guest* windows with alt tab ;)
>
> It is a tricky usability issue.

Clearly, the GUI needs to read the user's mind to figure out what they meant to 
do :-)

I think a menu option at least let's the user choose the behavior.  I think 
that's the best we're going to be able to do.

Regards,

Anthony Liguori

>
> cheers,
>    Gerd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-27 16:44           ` Anthony Liguori
@ 2012-02-27 16:54             ` Gerd Hoffmann
  0 siblings, 0 replies; 38+ messages in thread
From: Gerd Hoffmann @ 2012-02-27 16:54 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefano Stabellini, Jan Kiszka, qemu-devel,
	Alex Graf, Stefan Weil, Paolo Bonzini

  Hi,

> Clearly, the GUI needs to read the user's mind to figure out what they
> meant to do :-)

Fine with me.  /me looks forward reviewing patches.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2)
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2) Anthony Liguori
@ 2012-02-27 20:10   ` Stefan Weil
  2012-02-27 22:01     ` Anthony Liguori
  2012-02-28 14:18     ` Kevin Wolf
  0 siblings, 2 replies; 38+ messages in thread
From: Stefan Weil @ 2012-02-27 20:10 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, qemu-devel

Am 27.02.2012 00:46, 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 <aliguori@us.ibm.com>
> ---
> v1 -> v2
> - fix scaling (Paolo)
> - use ctrl-alt-+ instead of ctrl-alt-= for zoom
> ---
> ui/gtk.c | 92 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
> 1 files changed, 88 insertions(+), 4 deletions(-)
>
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 0dac807..578cb94 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c

[...]

>
> + s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full 
> Screen");

I suggest using the GTK standard widget GTK_STOCK_FULLSCREEN here.
That's not a check menu item, so some more changes will be needed.

Full screen mode does not need a check menu item, because you only
see the menu item when it is not in full screen mode.

> + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item),
> + "<QEMU>/View/Full Screen");
> + gtk_accel_map_add_entry("<QEMU>/View/Full Screen", GDK_KEY_f, 
> GDK_CONTROL_MASK | GDK_MOD1_MASK);
> + gtk_menu_append(GTK_MENU(s->view_menu), s->full_screen_item);
> +
> + separator = gtk_separator_menu_item_new();
> + gtk_menu_append(GTK_MENU(s->view_menu), separator);
> +
> + 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),
> + "<QEMU>/View/Zoom In");
> + gtk_accel_map_add_entry("<QEMU>/View/Zoom In", GDK_KEY_plus, 
> 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),
> + "<QEMU>/View/Zoom Out");
> + gtk_accel_map_add_entry("<QEMU>/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);
>

As was already said, GTK_STOCK_ZOOM_100 with accelerator GDK_KEY_0
would complete the zooming menu entries.

In your previous patch, you scaled s->scale_x *= 1.25 (which was correct)
and s->scale_x *= 0.75 (which should have been s->scale_x *= 0.8).

Why do you now use s->scale_x += .25, s->scale_x -= .25?
Linear scaling is uncommon and not what I'd expect when I read
25 % zooming in / out. I know that SDL also uses linear scaling,
but GTK wants to be better than SDL.

Regards,

Stefan Weil

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2)
  2012-02-27 20:10   ` Stefan Weil
@ 2012-02-27 22:01     ` Anthony Liguori
  2012-02-28 14:18     ` Kevin Wolf
  1 sibling, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-02-27 22:01 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paolo Bonzini, Anthony Liguori, qemu-devel

On 02/27/2012 02:10 PM, Stefan Weil wrote:
> Am 27.02.2012 00:46, 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 <aliguori@us.ibm.com>
>> ---
>> v1 -> v2
>> - fix scaling (Paolo)
>> - use ctrl-alt-+ instead of ctrl-alt-= for zoom
>> ---
>> ui/gtk.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
>> 1 files changed, 88 insertions(+), 4 deletions(-)
>>
>> diff --git a/ui/gtk.c b/ui/gtk.c
>> index 0dac807..578cb94 100644
>> --- a/ui/gtk.c
>> +++ b/ui/gtk.c
>
> [...]
>
>>
>> + s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full Screen");
>
> I suggest using the GTK standard widget GTK_STOCK_FULLSCREEN here.
> That's not a check menu item, so some more changes will be needed.
>
> Full screen mode does not need a check menu item, because you only
> see the menu item when it is not in full screen mode.

Yeah, I've thought about this myself too.  In the very least, we could use the 
stock item's label.  I've been on the fence about check vs. image.

Regarding use of a check menu item.  I've thought about this too.  In the past, 
it was common to have an "Enter Fullscreen" and a "Leave Fullscreen" option 
although now it seems to have a single check item for Fullscreen.  Both evince 
and firefox do this for instance.

It definitely makes sense programatically (it's a toggle after all).  If we did 
something like have an autohiding menubar when in full screen mode, it would 
also make more sense from a UI perspective.

>
>> + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->full_screen_item),
>> + "<QEMU>/View/Full Screen");
>> + gtk_accel_map_add_entry("<QEMU>/View/Full Screen", GDK_KEY_f,
>> GDK_CONTROL_MASK | GDK_MOD1_MASK);
>> + gtk_menu_append(GTK_MENU(s->view_menu), s->full_screen_item);
>> +
>> + separator = gtk_separator_menu_item_new();
>> + gtk_menu_append(GTK_MENU(s->view_menu), separator);
>> +
>> + 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),
>> + "<QEMU>/View/Zoom In");
>> + gtk_accel_map_add_entry("<QEMU>/View/Zoom In", GDK_KEY_plus,
>> 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),
>> + "<QEMU>/View/Zoom Out");
>> + gtk_accel_map_add_entry("<QEMU>/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);
>>
>
> As was already said, GTK_STOCK_ZOOM_100 with accelerator GDK_KEY_0
> would complete the zooming menu entries.

Yeah, should be easy enough to add.

> In your previous patch, you scaled s->scale_x *= 1.25 (which was correct)
> and s->scale_x *= 0.75 (which should have been s->scale_x *= 0.8).
>
> Why do you now use s->scale_x += .25, s->scale_x -= .25?
> Linear scaling is uncommon and not what I'd expect when I read
> 25 % zooming in / out. I know that SDL also uses linear scaling,
> but GTK wants to be better than SDL.

I was suspicious that floating point math was causing undesirable rounding such 
that I was a pixel off when you zoomed out and zoomed back to 100%.  Stretching 
by 1 pixel tends to create a very noticeable artifact with text.

I think we could do exponential scaling but store the exponent instead of the 
straight factor.  That would avoid any accumulated rounding error.

Regards,

Anthony Liguori

> Regards,
>
> Stefan Weil
>
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 7/8] gtk: add translation support
  2012-02-26 23:46 ` [Qemu-devel] [PATCH 7/8] gtk: add translation support Anthony Liguori
  2012-02-27  8:32   ` Paolo Bonzini
@ 2012-02-27 22:09   ` Stefan Weil
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Weil @ 2012-02-27 22:09 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, Alex Graf

Am 27.02.2012 00:46, schrieb Anthony Liguori:
> The de_DE translation is just a placeholder so that I could test the
> infrastructure.
>
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
> ---
>   Makefile       |    3 +++
>   configure      |    4 ++++
>   po/Makefile    |   43 +++++++++++++++++++++++++++++++++++++++++++
>   po/de_DE.po    |   37 +++++++++++++++++++++++++++++++++++++
>   po/messages.po |   37 +++++++++++++++++++++++++++++++++++++
>   ui/gtk.c       |   18 +++++++++++++-----
>   6 files changed, 137 insertions(+), 5 deletions(-)
>   create mode 100644 po/Makefile
>   create mode 100644 po/de_DE.po
>   create mode 100644 po/messages.po
>
>    

What about using the Translation Project (which is already used
by other well known GTK based projects) for QEMU, too?

See http://translationproject.org/ for more information.

Regards,

Stefan Weil

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2)
  2012-02-27 20:10   ` Stefan Weil
  2012-02-27 22:01     ` Anthony Liguori
@ 2012-02-28 14:18     ` Kevin Wolf
  1 sibling, 0 replies; 38+ messages in thread
From: Kevin Wolf @ 2012-02-28 14:18 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Paolo Bonzini, Anthony Liguori, qemu-devel

Am 27.02.2012 21:10, schrieb Stefan Weil:
> Am 27.02.2012 00:46, 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 <aliguori@us.ibm.com>
>> ---
>> v1 -> v2
>> - fix scaling (Paolo)
>> - use ctrl-alt-+ instead of ctrl-alt-= for zoom
>> ---
>> ui/gtk.c | 92 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
>> 1 files changed, 88 insertions(+), 4 deletions(-)
>>
>> diff --git a/ui/gtk.c b/ui/gtk.c
>> index 0dac807..578cb94 100644
>> --- a/ui/gtk.c
>> +++ b/ui/gtk.c
> 
> [...]
> 
>>
>> + s->full_screen_item = gtk_check_menu_item_new_with_mnemonic("_Full 
>> Screen");
> 
> I suggest using the GTK standard widget GTK_STOCK_FULLSCREEN here.
> That's not a check menu item, so some more changes will be needed.
> 
> Full screen mode does not need a check menu item, because you only
> see the menu item when it is not in full screen mode.

Tried Alt-V in full screen mode? ;-)

(Yes, I'd consider it a bug)

Kevin

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 7/8] gtk: add translation support
  2012-02-27  8:32   ` Paolo Bonzini
  2012-02-27 13:11     ` Anthony Liguori
@ 2012-02-28 15:10     ` Kevin Wolf
  1 sibling, 0 replies; 38+ messages in thread
From: Kevin Wolf @ 2012-02-28 15:10 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Anthony Liguori

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

Am 27.02.2012 09:32, schrieb Paolo Bonzini:
> On 02/27/2012 12:46 AM, Anthony Liguori wrote:
>> The de_DE translation is just a placeholder so that I could test the
>> infrastructure.
> 
> Here is an it_IT translation that you can use instead.

And here's a real de_DE.

Kevin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: de_DE.po --]
[-- Type: text/x-gettext-translation; name="de_DE.po", Size: 899 bytes --]

# German translation for QEMU.
# This file is put in the public domain.
# Kevin Wolf <kwolf@redhat.com>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: QEMU 1.0.50\n"
"Report-Msgid-Bugs-To: qemu-devel@nongnu.org\n"
"POT-Creation-Date: 2012-02-26 11:30-0600\n"
"PO-Revision-Date: 2012-02-28 16:00+0100\n"
"Last-Translator: Kevin Wolf <kwolf@redhat.com>\n"
"Language-Team: Deutsch <de@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n"

#: ../ui/gtk.c:769
msgid "_File"
msgstr "_Datei"

#: ../ui/gtk.c:779
msgid "_View"
msgstr "_Ansicht"

#: ../ui/gtk.c:781
msgid "_Full Screen"
msgstr "Voll_bild"

#: ../ui/gtk.c:805
msgid "_Grab Input"
msgstr "_Eingabegeräte einfangen"

#: ../ui/gtk.c:831
msgid "Show _Tabs"
msgstr "_Tableiste anzeigen"

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
                   ` (10 preceding siblings ...)
  2012-02-27 14:24 ` Kevin Wolf
@ 2012-03-11 17:29 ` Stefan Weil
  2012-03-11 18:24   ` François Revol
  2012-03-12  2:30   ` Anthony Liguori
  11 siblings, 2 replies; 38+ messages in thread
From: Stefan Weil @ 2012-03-11 17:29 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, Alex Graf

Am 27.02.2012 00:46, schrieb Anthony Liguori:
> I realize UIs are the third rail of QEMU development, but over the 
> years I've
> gotten a lot of feedback from users about our UI. I think everyone 
> struggles
> with the SDL interface and its lack of discoverability but it's worse 
> than I
> think most people realize for users that rely on accessibility tools.
>
> The two pieces of feedback I've gotten the most re: accessibility are 
> the lack
> of QEMU's enablement for screen readers and the lack of configurable
> accelerators.
>
> Since we render our own terminal using a fixed sized font, we don't 
> respect
> system font settings which means we ignore if the user has configured 
> large
> print.
>
> We also don't integrate at all with screen readers which means that 
> for blind
> users, the virtual consoles may as well not even exist.
>
> We also don't allow any type of configuration of accelerators. For 
> users with
> limited dexterity (this is actually more common than you would think), 
> they may
> use an input device that only inputs one key at a time. Holding down 
> two keys
> at once is not possible for these users.
>
> These are solved problems though and while we could reinvent all of this
> ourselves with SDL, we would be crazy if we did. Modern toolkits, like 
> GTK,
> solve these problems.
>
> By using GTK, we can leverage VteTerminal for screen reader 
> integration and font
> configuration. We can also use GTK's accelerator support to make 
> accelerators
> configurable (Gnome provides a global accelerator configuration 
> interface).
>
> I'm not attempting to make a pretty desktop virtualization UI. Maybe 
> we'll go
> there eventually but that's not what this series is about.
>
> This is just attempting to use a richer toolkit such that we can 
> enable basic
> accessibility support. As a consequence, the UI is much more usable 
> even for a
> user without accessibility requirements so it's a win-win.
>
> Also available at:
>
> https://github.com/aliguori/qemu/tree/gtk.2
>
> ---
> v1 -> v2
> - Add internationalization support. I don't actually speak any other 
> languages
> so I added a placeholder for a German translation. This can be tested with
> LANGUAGE=de_DE.UTF-8 qemu-system-x86_64
> - Fixed the terminal size for VteTerminal widgets. I think the 
> behavior makes
> sense now.
> - Fixed lots of issues raised in review comments (see individual patches)
>
> Known Issues:
> - I saw the X crash once. I think it has to do with widget sizes. I 
> need to
> work harder to reproduce.
> - I've not recreated the reported memory leak yet.
> - I haven't added backwards compatibility code for older VteTerminal 
> widgets
> yet.

Hi Anthony,

are you still working on a new version of this patch series?

I suggest to commit a slightly modified version of v2 which adds the
GTK UI as an optional user interface (only enabled by a configure option).

This makes testing easier and allows developers to send patches which
improve the new UI.

As soon as the GTK UI is considered stable and usable, the default
could be changed from SDL to GTK.

Regards,
Stefan Weil

PS. Of course the committed patches should pass checkpatch.pl without 
errors.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-11 17:29 ` Stefan Weil
@ 2012-03-11 18:24   ` François Revol
  2012-03-11 18:47     ` Stefan Weil
  2012-03-12  2:31     ` Anthony Liguori
  2012-03-12  2:30   ` Anthony Liguori
  1 sibling, 2 replies; 38+ messages in thread
From: François Revol @ 2012-03-11 18:24 UTC (permalink / raw)
  To: Stefan Weil
  Cc: Kevin Wolf, Paolo Bonzini, Anthony Liguori, qemu-devel, Alex Graf

On -10/01/-28163 20:59, Stefan Weil wrote:
> Am 27.02.2012 00:46, schrieb Anthony Liguori:
>> I realize UIs are the third rail of QEMU development, but over the
>> years I've
>> gotten a lot of feedback from users about our UI. I think everyone
>> struggles
>> with the SDL interface and its lack of discoverability but it's worse
>> than I
>> think most people realize for users that rely on accessibility tools.
[...]

While I do think accessibility is important...

>> These are solved problems though and while we could reinvent all of this
>> ourselves with SDL, we would be crazy if we did. Modern toolkits, like
>> GTK,
>> solve these problems.

GTK itself causes problems, because, it's not ported, thus not
available, to all platforms QEMU can run on.

It's certainly not available on Haiku at least.

Of course, SDL itself is not really a good candidate to add a11y
features, due to its framebuffer-based design...

>>
>> By using GTK, we can leverage VteTerminal for screen reader
>> integration and font
>> configuration. We can also use GTK's accelerator support to make
>> accelerators
>> configurable (Gnome provides a global accelerator configuration
>> interface).

Hmm the thing using libvte that uses /tmp to insecurely store terminal
backlogs ? ;-)

[snip]

> As soon as the GTK UI is considered stable and usable, the default
> could be changed from SDL to GTK.

Due to GTK not being as universally available as SDL, I'd really like
not to.

François.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-11 18:24   ` François Revol
@ 2012-03-11 18:47     ` Stefan Weil
  2012-03-12  2:31     ` Anthony Liguori
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Weil @ 2012-03-11 18:47 UTC (permalink / raw)
  To: François Revol
  Cc: Kevin Wolf, Paolo Bonzini, Anthony Liguori, qemu-devel, Alex Graf

Am 11.03.2012 19:24, schrieb François Revol:
> On -10/01/-28163 20:59, Stefan Weil wrote:
>> Am 27.02.2012 00:46, schrieb Anthony Liguori:
>>> I realize UIs are the third rail of QEMU development, but over the
>>> years I've
>>> gotten a lot of feedback from users about our UI. I think everyone
>>> struggles
>>> with the SDL interface and its lack of discoverability but it's worse
>>> than I
>>> think most people realize for users that rely on accessibility tools.
> [...]
>
> While I do think accessibility is important...
>
>>> These are solved problems though and while we could reinvent all of this
>>> ourselves with SDL, we would be crazy if we did. Modern toolkits, like
>>> GTK,
>>> solve these problems.
>
> GTK itself causes problems, because, it's not ported, thus not
> available, to all platforms QEMU can run on.
>
> It's certainly not available on Haiku at least.
>
> Of course, SDL itself is not really a good candidate to add a11y
> features, due to its framebuffer-based design...
>
>>>
>>> By using GTK, we can leverage VteTerminal for screen reader
>>> integration and font
>>> configuration. We can also use GTK's accelerator support to make
>>> accelerators
>>> configurable (Gnome provides a global accelerator configuration
>>> interface).
>
> Hmm the thing using libvte that uses /tmp to insecurely store terminal
> backlogs ? ;-)
>
> [snip]
>> As soon as the GTK UI is considered stable and usable, the default
>> could be changed from SDL to GTK.
>
> Due to GTK not being as universally available as SDL, I'd really like
> not to.
>
> François.

Agreed. I should have been more precise. The default could be
changed from SDL to GTK when GTK is available and working
(this implies not for Haiku, not for compilation environments
without the necessary GTK installation, and also not for Windows
as long as the GTK UI freezes QEMU).

Stefan

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-11 17:29 ` Stefan Weil
  2012-03-11 18:24   ` François Revol
@ 2012-03-12  2:30   ` Anthony Liguori
  1 sibling, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-03-12  2:30 UTC (permalink / raw)
  To: Stefan Weil; +Cc: Kevin Wolf, Paolo Bonzini, qemu-devel, Alex Graf

On 03/11/2012 12:29 PM, Stefan Weil wrote:
> Hi Anthony,
>
> are you still working on a new version of this patch series?

Yeah, but this is purely a free time project which is in short supply these days :-)

> I suggest to commit a slightly modified version of v2 which adds the
> GTK UI as an optional user interface (only enabled by a configure option).

The big thing I have on my TODO list is understanding what's happening with 
resizing.  I'm actually in the process of upgrading to GTK3 so I hope I'll see 
the issues other people are having.

I'll try to get a new series out as soon as I have some free time.

Regards,

Anthony Liguori

>
> This makes testing easier and allows developers to send patches which
> improve the new UI.
>
> As soon as the GTK UI is considered stable and usable, the default
> could be changed from SDL to GTK.
>
> Regards,
> Stefan Weil
>
> PS. Of course the committed patches should pass checkpatch.pl without errors.
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-11 18:24   ` François Revol
  2012-03-11 18:47     ` Stefan Weil
@ 2012-03-12  2:31     ` Anthony Liguori
  2012-03-12 16:39       ` François Revol
  1 sibling, 1 reply; 38+ messages in thread
From: Anthony Liguori @ 2012-03-12  2:31 UTC (permalink / raw)
  To: François Revol
  Cc: Kevin Wolf, Stefan Weil, Alex Graf, qemu-devel, Paolo Bonzini

On 03/11/2012 01:24 PM, François Revol wrote:
> GTK itself causes problems, because, it's not ported, thus not
> available, to all platforms QEMU can run on.
>
> It's certainly not available on Haiku at least.

There is no perfect solution here.  I think GTK is the best that's out there.

>>> By using GTK, we can leverage VteTerminal for screen reader
>>> integration and font
>>> configuration. We can also use GTK's accelerator support to make
>>> accelerators
>>> configurable (Gnome provides a global accelerator configuration
>>> interface).
>
> Hmm the thing using libvte that uses /tmp to insecurely store terminal
> backlogs ? ;-)

Yeah, I saw it on a blog, it must be true!

Regards,

Anthony Liguori


>> As soon as the GTK UI is considered stable and usable, the default
>> could be changed from SDL to GTK.
>
> Due to GTK not being as universally available as SDL, I'd really like
> not to.
>
> François.
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-12  2:31     ` Anthony Liguori
@ 2012-03-12 16:39       ` François Revol
  2012-03-12 17:13         ` Anthony Liguori
  0 siblings, 1 reply; 38+ messages in thread
From: François Revol @ 2012-03-12 16:39 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, Stefan Weil, Alex Graf, qemu-devel, Paolo Bonzini

On 12/03/2012 03:31, Anthony Liguori wrote:
> On 03/11/2012 01:24 PM, François Revol wrote:
>> GTK itself causes problems, because, it's not ported, thus not
>> available, to all platforms QEMU can run on.
>>
>> It's certainly not available on Haiku at least.
> 
> There is no perfect solution here.  I think GTK is the best that's out
> there.

Well as long as it's not mandatory...

>>>> By using GTK, we can leverage VteTerminal for screen reader
>>>> integration and font
>>>> configuration. We can also use GTK's accelerator support to make
>>>> accelerators
>>>> configurable (Gnome provides a global accelerator configuration
>>>> interface).
>>
>> Hmm the thing using libvte that uses /tmp to insecurely store terminal
>> backlogs ? ;-)
> 
> Yeah, I saw it on a blog, it must be true!

Well it is true, just fill up your /tmp and see the backlog stop working
in gnome-terminal. I did it unintentionally the other day... :P

François.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2)
  2012-03-12 16:39       ` François Revol
@ 2012-03-12 17:13         ` Anthony Liguori
  0 siblings, 0 replies; 38+ messages in thread
From: Anthony Liguori @ 2012-03-12 17:13 UTC (permalink / raw)
  To: François Revol
  Cc: Kevin Wolf, Stefan Weil, Alex Graf, qemu-devel, Paolo Bonzini

On 03/12/2012 11:39 AM, François Revol wrote:
> On 12/03/2012 03:31, Anthony Liguori wrote:
>> On 03/11/2012 01:24 PM, François Revol wrote:
>>> GTK itself causes problems, because, it's not ported, thus not
>>> available, to all platforms QEMU can run on.
>>>
>>> It's certainly not available on Haiku at least.
>>
>> There is no perfect solution here.  I think GTK is the best that's out
>> there.
>
> Well as long as it's not mandatory...
>
>>>>> By using GTK, we can leverage VteTerminal for screen reader
>>>>> integration and font
>>>>> configuration. We can also use GTK's accelerator support to make
>>>>> accelerators
>>>>> configurable (Gnome provides a global accelerator configuration
>>>>> interface).
>>>
>>> Hmm the thing using libvte that uses /tmp to insecurely store terminal
>>> backlogs ? ;-)
>>
>> Yeah, I saw it on a blog, it must be true!
>
> Well it is true, just fill up your /tmp and see the backlog stop working
> in gnome-terminal. I did it unintentionally the other day... :P

The issue is viewing '/tmp' as "insecure".  Per-user TMPDIR has existed almost 
for a decade now.  Moreover, /tmp files can be created safely using the 
appropriate syscalls (which VTE uses).

If you're worried about securing your data and are surprised by the fact that 
/tmp isn't encrypted, you should be using full disk encryption because /tmp 
isn't the only place that needs to be worried about.

Regards,

Anthony Liguori

>
> François.
>

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2012-03-12 17:13 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-26 23:46 [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) Anthony Liguori
2012-02-26 23:46 ` [Qemu-devel] [PATCH 1/8] console: allow VCs to be overridden by UI Anthony Liguori
2012-02-26 23:46 ` [Qemu-devel] [PATCH 2/8] chr: check to see if front end has registered a read function Anthony Liguori
2012-02-26 23:46 ` [Qemu-devel] [PATCH 3/8] ui: add basic GTK gui (v2) Anthony Liguori
2012-02-26 23:46 ` [Qemu-devel] [PATCH 4/8] gtk: add virtual console support (v2) Anthony Liguori
2012-02-27 10:45   ` Kevin Wolf
2012-02-26 23:46 ` [Qemu-devel] [PATCH 5/8] gtk: add support for input grabbing Anthony Liguori
2012-02-26 23:46 ` [Qemu-devel] [PATCH 6/8] gtk: add support for screen scaling and full screen (v2) Anthony Liguori
2012-02-27 20:10   ` Stefan Weil
2012-02-27 22:01     ` Anthony Liguori
2012-02-28 14:18     ` Kevin Wolf
2012-02-26 23:46 ` [Qemu-devel] [PATCH 7/8] gtk: add translation support Anthony Liguori
2012-02-27  8:32   ` Paolo Bonzini
2012-02-27 13:11     ` Anthony Liguori
2012-02-28 15:10     ` Kevin Wolf
2012-02-27 22:09   ` Stefan Weil
2012-02-26 23:46 ` [Qemu-devel] [PATCH 8/8] gtk: make default UI Anthony Liguori
2012-02-27  7:23 ` [Qemu-devel] [PATCH 0/8] Add GTK UI to enable basic accessibility (v2) malc
2012-02-27  8:21 ` Jan Kiszka
2012-02-27 13:10   ` Anthony Liguori
2012-02-27 13:26     ` Jan Kiszka
2012-02-27 13:33       ` Anthony Liguori
2012-02-27 13:42         ` Jan Kiszka
2012-02-27 13:50           ` Anthony Liguori
2012-02-27 13:54             ` Jan Kiszka
2012-02-27 16:39         ` Gerd Hoffmann
2012-02-27 16:44           ` Anthony Liguori
2012-02-27 16:54             ` Gerd Hoffmann
2012-02-27 14:24 ` Kevin Wolf
2012-02-27 14:39   ` Anthony Liguori
2012-02-27 15:03     ` Kevin Wolf
2012-03-11 17:29 ` Stefan Weil
2012-03-11 18:24   ` François Revol
2012-03-11 18:47     ` Stefan Weil
2012-03-12  2:31     ` Anthony Liguori
2012-03-12 16:39       ` François Revol
2012-03-12 17:13         ` Anthony Liguori
2012-03-12  2:30   ` Anthony Liguori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.