aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/curses.c4
-rw-r--r--ui/gtk.c27
2 files changed, 26 insertions, 5 deletions
diff --git a/ui/curses.c b/ui/curses.c
index d06f724879..2e132a7bfa 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -369,10 +369,10 @@ static void curses_setup(void)
/* ACS_* is not constant. So, we can't initialize statically. */
vga_to_curses['\0'] = ' ';
vga_to_curses[0x04] = ACS_DIAMOND;
- vga_to_curses[0x0a] = ACS_RARROW;
- vga_to_curses[0x0b] = ACS_LARROW;
vga_to_curses[0x18] = ACS_UARROW;
vga_to_curses[0x19] = ACS_DARROW;
+ vga_to_curses[0x1a] = ACS_RARROW;
+ vga_to_curses[0x1b] = ACS_LARROW;
vga_to_curses[0x9c] = ACS_STERLING;
vga_to_curses[0xb0] = ACS_BOARD;
vga_to_curses[0xb1] = ACS_CKBOARD;
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),