summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-10-30 14:45:53 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-10-30 14:45:53 +0000
commit3c1d9a15be679afd3fb9173a242827ff2d43af8f (patch)
tree10853247c3a1ff63063df2eb53eb7fc97bf9b995 /ui
parent08118672d06c8d2fb937cab5c97b2dfdc8786520 (diff)
parent316cb068bdaf456040934f7368e09be7be4d942e (diff)
downloadqemu-3c1d9a15be679afd3fb9173a242827ff2d43af8f.tar.gz
qemu-3c1d9a15be679afd3fb9173a242827ff2d43af8f.tar.bz2
qemu-3c1d9a15be679afd3fb9173a242827ff2d43af8f.zip
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20141028-1' into staging
gtk: fix two warnings with gtk 3.14+ # gpg: Signature made Tue 28 Oct 2014 10:25:52 GMT 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-20141028-1: gtk: avoid gd_widget_reparent with gtk 3.14+ gtk: drop gtk_widget_set_double_buffered call Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 8e055da0dc..a5f6869e9a 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -435,6 +435,15 @@ static void gtk_release_modifiers(GtkDisplayState *s)
}
}
+static void gd_widget_reparent(GtkWidget *from, GtkWidget *to,
+ GtkWidget *widget)
+{
+ g_object_ref(G_OBJECT(widget));
+ gtk_container_remove(GTK_CONTAINER(from), widget);
+ gtk_container_add(GTK_CONTAINER(to), widget);
+ g_object_unref(G_OBJECT(widget));
+}
+
/** DisplayState Callbacks **/
static void gd_update(DisplayChangeListener *dcl,
@@ -1031,7 +1040,7 @@ static gboolean gd_tab_window_close(GtkWidget *widget, GdkEvent *event,
GtkDisplayState *s = vc->s;
gtk_widget_set_sensitive(vc->menu_item, true);
- gtk_widget_reparent(vc->tab_item, s->notebook);
+ gd_widget_reparent(vc->window, s->notebook, vc->tab_item);
gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(s->notebook),
vc->tab_item, vc->label);
gtk_widget_destroy(vc->window);
@@ -1065,7 +1074,7 @@ static void gd_menu_untabify(GtkMenuItem *item, void *opaque)
if (!vc->window) {
gtk_widget_set_sensitive(vc->menu_item, false);
vc->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_reparent(vc->tab_item, vc->window);
+ gd_widget_reparent(s->notebook, vc->window, vc->tab_item);
g_signal_connect(vc->window, "delete-event",
G_CALLBACK(gd_tab_window_close), vc);
@@ -1666,7 +1675,6 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
GDK_LEAVE_NOTIFY_MASK |
GDK_SCROLL_MASK |
GDK_KEY_PRESS_MASK);
- gtk_widget_set_double_buffered(vc->gfx.drawing_area, FALSE);
gtk_widget_set_can_focus(vc->gfx.drawing_area, TRUE);
vc->type = GD_VC_GFX;