[Xfce4-commits] [apps/parole] 01/01: Work around new deprecations in gtk 3.12

noreply at xfce.org noreply at xfce.org
Sat Jun 28 22:58:12 CEST 2014


This is an automated email from the git hooks/post-receive script.

bluesabre pushed a commit to branch master
in repository apps/parole.

commit 50a8a20a7bcdcc9656ecd9c51ea769938bba7378
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Jun 28 16:58:06 2014 -0400

    Work around new deprecations in gtk 3.12
---
 src/common/parole-common.c       |   18 ++++++++++++++++++
 src/common/parole-common.h       |    2 ++
 src/gst/parole-gst.c             |    4 ++++
 src/parole-clutter.c             |    6 ------
 src/parole-player.c              |   14 ++++++++++----
 src/plugins/tray/tray-provider.c |    7 ++++++-
 6 files changed, 40 insertions(+), 11 deletions(-)

diff --git a/src/common/parole-common.c b/src/common/parole-common.c
index 822cd31..d811080 100644
--- a/src/common/parole-common.c
+++ b/src/common/parole-common.c
@@ -34,6 +34,24 @@
 
 #include "parole-common.h"
 
+gboolean
+parole_widget_reparent (GtkWidget *widget, GtkWidget *new_parent)
+{
+    GtkWidget *parent;
+
+    parent = gtk_widget_get_parent(widget);
+    if (parent)
+    {
+        g_object_ref (widget);
+        gtk_container_remove (GTK_CONTAINER(parent), widget);
+        gtk_container_add (GTK_CONTAINER(new_parent), widget);
+        g_object_unref (widget);
+
+        return TRUE;
+    }
+
+    return FALSE;
+}
 
 static void
 parole_dialog_show (GtkWindow *parent,
diff --git a/src/common/parole-common.h b/src/common/parole-common.h
index d458874..1b6bca5 100644
--- a/src/common/parole-common.h
+++ b/src/common/parole-common.h
@@ -26,6 +26,8 @@
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 
+gboolean    parole_widget_reparent          (GtkWidget *widget,
+                                             GtkWidget *new_parent);
 
 void        parole_dialog_info              (GtkWindow *parent,
                                              const gchar *title,
diff --git a/src/gst/parole-gst.c b/src/gst/parole-gst.c
index 03a0a88..7be218b 100644
--- a/src/gst/parole-gst.c
+++ b/src/gst/parole-gst.c
@@ -2432,7 +2432,11 @@ parole_gst_init (ParoleGst *gst)
      * Disable double buffering on the video output to avoid
      * flickering when resizing the window.
      */
+#if GTK_CHECK_VERSION(3,12,0)
+    /* Deprecated in 3.12, noticeable regression with X, XV, no change for clutter */
+#else
     gtk_widget_set_double_buffered (GTK_WIDGET (gst), FALSE);
+#endif
 }
 
 GtkWidget *
diff --git a/src/parole-clutter.c b/src/parole-clutter.c
index 24f2a55..4399410 100644
--- a/src/parole-clutter.c
+++ b/src/parole-clutter.c
@@ -341,12 +341,6 @@ parole_clutter_init (ParoleClutter *clutter)
     clutter_actor_add_child (clutter->priv->stage, clutter->priv->texture);
 
     gtk_widget_set_can_focus (GTK_WIDGET (clutter), TRUE);
-
-    /*
-     * Disable double buffering on the video output to avoid
-     * flickering when resizing the window.
-     */
-    gtk_widget_set_double_buffered (GTK_WIDGET (clutter), FALSE);
 }
 
 GtkWidget *
diff --git a/src/parole-player.c b/src/parole-player.c
index 21d3aba..6873910 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -2837,7 +2837,8 @@ on_goto_position_clicked (GtkWidget *w, ParolePlayer *player)
 
     label = gtk_label_new (_("Position:"));
     gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-    gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+    gtk_widget_set_halign (GTK_WIDGET(label), GTK_ALIGN_START);
+    gtk_widget_set_valign (GTK_WIDGET(label), GTK_ALIGN_CENTER);
 
     /* Get the stream length and set that as maximum for hours and minutes */
     adjustment = gtk_range_get_adjustment (GTK_RANGE (player->priv->range));
@@ -3125,7 +3126,11 @@ parole_player_init (ParolePlayer *player)
     GtkWidget *audiotrack_box, *audiotrack_label, *subtitle_box, *subtitle_label, *infobar_close, *close_icon;
     GtkWidget *content_area;
 
-    GtkWidget *controls_overlay, *tmp_box;
+    GtkWidget *controls_overlay;
+#if GTK_CHECK_VERSION(3,10,0)
+#else
+    GtkWidget *tmp_box;
+#endif
     GtkWidget *controls_parent;
     GtkWidget *play_box;
 
@@ -3397,7 +3402,8 @@ parole_player_init (ParolePlayer *player)
     play_box = GTK_WIDGET (gtk_builder_get_object (builder, "media_controls"));
     controls_parent = GTK_WIDGET(gtk_builder_get_object (builder, "box2"));
     gtk_box_pack_start (GTK_BOX(controls_parent), controls_overlay, TRUE, TRUE, 0);
-    gtk_widget_reparent(GTK_WIDGET(player->priv->eventbox_output), controls_overlay);
+
+    parole_widget_reparent(GTK_WIDGET(player->priv->eventbox_output), controls_overlay);
 
 #if GTK_CHECK_VERSION(3,8,0)
 #else
@@ -3414,7 +3420,7 @@ parole_player_init (ParolePlayer *player)
     gtk_revealer_set_reveal_child(GTK_REVEALER(player->priv->revealer), TRUE);
     gtk_widget_set_valign(player->priv->revealer, GTK_ALIGN_END);
 
-    gtk_widget_reparent(GTK_WIDGET(player->priv->control), player->priv->revealer);
+    parole_widget_reparent(GTK_WIDGET(player->priv->control), player->priv->revealer);
 
     gtk_overlay_add_overlay(GTK_OVERLAY(controls_overlay), player->priv->revealer);
     gtk_widget_show_all(player->priv->revealer);
diff --git a/src/plugins/tray/tray-provider.c b/src/plugins/tray/tray-provider.c
index 36fd502..e5edb8f 100644
--- a/src/plugins/tray/tray-provider.c
+++ b/src/plugins/tray/tray-provider.c
@@ -357,7 +357,12 @@ delete_event_cb (GtkWidget *widget, GdkEvent *ev, TrayProvider *tray)
               G_CALLBACK (action_on_hide_confirmed_cb), NULL);
 
     gtk_box_pack_start (GTK_BOX (content_area), check, TRUE, TRUE, 0);
-    gtk_widget_set_margin_left(GTK_WIDGET(check), 3);
+
+#if GTK_CHECK_VERSION(3,12,0)
+    gtk_widget_set_margin_start (GTK_WIDGET(check), 3);
+#else
+    gtk_widget_set_margin_left (GTK_WIDGET(check), 3);
+#endif
 
     gtk_widget_show_all( GTK_WIDGET(dialog) );
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list