summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-07-11 13:48:07 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-07-11 13:48:07 +0100
commit22df3452dcab04adf57bda370ced35193395a475 (patch)
tree5242995b166768f5352da94ee7720e5bea09992a
parent74aeb37de06083ab130bf0da7c264043887c6c04 (diff)
parente72b59fa93b68635f42cdb1b1134f60dd4040d7b (diff)
downloadhqemu-22df3452dcab04adf57bda370ced35193395a475.zip
hqemu-22df3452dcab04adf57bda370ced35193395a475.tar.gz
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20140711-1' into staging
ui/gtk: Restore keyboard focus after Page change # gpg: Signature made Fri 11 Jul 2014 09:46:21 BST using RSA key ID D3E87138 # 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>" * remotes/kraxel/tags/pull-gtk-20140711-1: ui/gtk: Restore keyboard focus after Page change Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--ui/gtk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index b02fcd6..2345d7e 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -992,13 +992,16 @@ static void gd_menu_switch_vc(GtkMenuItem *item, void *opaque)
{
GtkDisplayState *s = opaque;
VirtualConsole *vc = gd_vc_find_by_menu(s);
+ GtkNotebook *nb = GTK_NOTEBOOK(s->notebook);
+ GtkWidget *child;
gint page;
gtk_release_modifiers(s);
if (vc) {
- page = gtk_notebook_page_num(GTK_NOTEBOOK(s->notebook),
- vc->tab_item);
- gtk_notebook_set_current_page(GTK_NOTEBOOK(s->notebook), page);
+ page = gtk_notebook_page_num(nb, vc->tab_item);
+ gtk_notebook_set_current_page(nb, page);
+ child = gtk_notebook_get_nth_page(nb, page);
+ gtk_widget_grab_focus(child);
}
}
OpenPOWER on IntegriCloud