diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-10-28 17:59:04 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2016-10-28 17:59:04 +0100 |
| commit | 5b2ecabaeabc17f032197246c4846b9ba95ba8a6 (patch) | |
| tree | a1590a81ad728d7babc25c814d2c52272566c64a /ui/gtk.c | |
| parent | eb540e2cc3ca9cdc4e47f319b6c5efea1906fc83 (diff) | |
| parent | 8ddc5bf9e5de51c2a4842c01dd3a97f5591776fd (diff) | |
| download | focaccia-qemu-5b2ecabaeabc17f032197246c4846b9ba95ba8a6.tar.gz focaccia-qemu-5b2ecabaeabc17f032197246c4846b9ba95ba8a6.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging
braille fixes and improvements. curses fix, switch to cursesw. gtk bugfixes. # gpg: Signature made Fri 28 Oct 2016 13:05:12 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-ui-20161028-1: curses: Use cursesw instead of curses curses: fix left/right arrow translation ui/gtk: Fix non-working DELETE key gtk: fix compilation warning with gtk 3.22.2 Defer BrlAPI tty acquisition to when guest starts using device Add dots keypresses support to the baum braille device Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/gtk.c')
| -rw-r--r-- | ui/gtk.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/ui/gtk.c b/ui/gtk.c index 25e6d9969d..ca737c48d9 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -912,9 +912,28 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion, if (!qemu_input_is_absolute() && s->ptr_owner == vc) { GdkScreen *screen = gtk_widget_get_screen(vc->gfx.drawing_area); + int screen_width, screen_height; + int x = (int)motion->x_root; int y = (int)motion->y_root; +#if GTK_CHECK_VERSION(3, 22, 0) + { + GdkDisplay *dpy = gtk_widget_get_display(widget); + GdkWindow *win = gtk_widget_get_window(widget); + GdkMonitor *monitor = gdk_display_get_monitor_at_window(dpy, win); + GdkRectangle geometry; + gdk_monitor_get_geometry(monitor, &geometry); + screen_width = geometry.width; + screen_height = geometry.height; + } +#else + { + screen_width = gdk_screen_get_width(screen); + screen_height = gdk_screen_get_height(screen); + } +#endif + /* 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 @@ -928,10 +947,10 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion, if (y == 0) { y += 200; } - if (x == (gdk_screen_get_width(screen) - 1)) { + if (x == (screen_width - 1)) { x -= 200; } - if (y == (gdk_screen_get_height(screen) - 1)) { + if (y == (screen_height - 1)) { y -= 200; } @@ -1051,7 +1070,9 @@ static gboolean gd_text_key_down(GtkWidget *widget, VirtualConsole *vc = opaque; QemuConsole *con = vc->gfx.dcl.con; - if (key->length) { + if (key->keyval == GDK_KEY_Delete) { + kbd_put_qcode_console(con, Q_KEY_CODE_DELETE); + } else if (key->length) { kbd_put_string_console(con, key->string, key->length); } else { int num = gd_map_keycode(vc->s, gtk_widget_get_display(widget), |