Skip to contentSkip to conversation

gtk: fix two warnings with gtk 3.14+

GIT PULL Applied Gerd Hoffmann 2 participants 4 messages Oct 28, 2014 – Oct 31, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

Small patch series fixing warnings with the latest gtk version.

please pull,
Gerd

The following changes since commit 3e9418e160cd8901c83a3c88967158084f5b5c03:

Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM synchronously" (2014-10-27 15:05:09 +0000)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-gtk-20141028-1

for you to fetch changes up to 316cb068bdaf456040934f7368e09be7be4d942e:

gtk: avoid gd_widget_reparent with gtk 3.14+ (2014-10-28 11:25:14 +0100)

----------------------------------------------------------------
gtk: fix two warnings with gtk 3.14+

----------------------------------------------------------------
Gerd Hoffmann (2):
gtk: drop gtk_widget_set_double_buffered call
gtk: avoid gd_widget_reparent with gtk 3.14+

 ui/gtk.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/2] gtk: drop gtk_widget_set_double_buffered call

Dunno why it is here. Removing it seems to have no ill side effects. It is depricated in 3.14+. In some cases it has no effect since 3.10 according to the docs:

https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-double-buffered

---
 ui/gtk.c | 1 -
 1 file changed, 1 deletion(-)
ui/gtk.c +0 -1
index 8e055da..9727dec 100644
@@ -1666,7 +1666,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;
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 2/2] gtk: avoid gd_widget_reparent with gtk 3.14+

In reply to Gerd Hoffmann

gtk_widget_reparent is depricated in gtk 3.14, stop using it.

---
 ui/gtk.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
ui/gtk.c +11 -2
index 9727dec..a5f6869 100644
@@ -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);
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 15 lines · Gerd Hoffmann

Hi,

Small patch series fixing warnings with the latest gtk version.

please pull,
Gerd

The following changes since commit 3e9418e160cd8901c83a3c88967158084f5b5c03:

Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM synchronously" (2014-10-27 15:05:09 +0000)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-gtk-20141028-1

Quoted 8 lines

for you to fetch changes up to 316cb068bdaf456040934f7368e09be7be4d942e:

gtk: avoid gd_widget_reparent with gtk 3.14+ (2014-10-28 11:25:14 +0100)

----------------------------------------------------------------
gtk: fix two warnings with gtk 3.14+

----------------------------------------------------------------

Applied, thanks.

-- PMM