[Xfce4-commits] <parole:master> * Don't return True on button release in gst to process other signal handlers (show the menu)

Ali Abdallah noreply at xfce.org
Fri Nov 20 12:08:02 CET 2009


Updating branch refs/heads/master
         to 57d4ea5bbf9d7c28f95f5980f87a1731c2cbf7d6 (commit)
       from 2bd4ac6fa8aa87f4a7d9f966529d6152dfa375e9 (commit)

commit 57d4ea5bbf9d7c28f95f5980f87a1731c2cbf7d6
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Fri Nov 20 12:02:05 2009 +0100

    * Don't return True on button release in gst to process other signal handlers
      (show the menu)
    
    * Fill empty space in the video widget black, the gst video widget
    must always be contained in its owen container, so do that in the
    browser media plugin

 browser-plugin/media-plugin/parole-plugin-player.c |    6 ++++-
 gst/parole-gst.c                                   |   24 ++++++++++++++++++-
 parole/parole-player.c                             |    3 +-
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/browser-plugin/media-plugin/parole-plugin-player.c b/browser-plugin/media-plugin/parole-plugin-player.c
index 34537c2..149c169 100644
--- a/browser-plugin/media-plugin/parole-plugin-player.c
+++ b/browser-plugin/media-plugin/parole-plugin-player.c
@@ -386,6 +386,7 @@ parole_plugin_player_construct (GObject *object)
 {
     ParolePluginPlayer *player;
     GtkObject *adj;
+    GtkWidget *gstbox;
     GtkWidget *vbox;
     GtkWidget *hbox;
     GtkWidget *img;
@@ -398,9 +399,12 @@ parole_plugin_player_construct (GObject *object)
     /*
      * Gst Widget
      */
+    gstbox = gtk_hbox_new (TRUE, 0);
+    
     player->priv->gst = PAROLE_GST (parole_gst_new (TRUE, NULL));
     
-    gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (player->priv->gst), TRUE, TRUE, 0);
+    gtk_box_pack_start (GTK_BOX (gstbox), GTK_WIDGET (player->priv->gst), TRUE, TRUE, 0);
+    gtk_box_pack_start (GTK_BOX (vbox), gstbox, TRUE, TRUE, 0);
     
     g_signal_connect (G_OBJECT (player->priv->gst), "media-state",
 		      G_CALLBACK (parole_plugin_player_media_state_cb), player);
diff --git a/gst/parole-gst.c b/gst/parole-gst.c
index 04e94b2..9017d58 100644
--- a/gst/parole-gst.c
+++ b/gst/parole-gst.c
@@ -164,6 +164,24 @@ parole_gst_configure_event_cb (GtkWidget *widget, GdkEventConfigure *ev, ParoleG
     return FALSE;
 }
 
+static gboolean
+parole_gst_parent_expose_event (GtkWidget *w, GdkEventExpose *ev, ParoleGst *gst)
+{
+    cairo_t *cr;
+    
+    cr = gdk_cairo_create (w->window);
+    
+    cairo_set_source_rgb (cr, 0.0f, 0.0f, 0.0f);
+    
+    cairo_rectangle (cr, w->allocation.x, w->allocation.y, w->allocation.width, w->allocation.height);
+    
+    cairo_fill (cr);
+    cairo_destroy (cr);
+    
+    return FALSE;
+}
+
+
 static void
 parole_gst_realize (GtkWidget *widget)
 {
@@ -205,6 +223,10 @@ parole_gst_realize (GtkWidget *widget)
     
     g_signal_connect (gtk_widget_get_toplevel (widget), "configure_event",
 		      G_CALLBACK (parole_gst_configure_event_cb), gst);
+		      
+    g_signal_connect (gtk_widget_get_parent (widget), "expose_event",
+		      G_CALLBACK (parole_gst_parent_expose_event), gst);
+
 }
 
 static void
@@ -471,7 +493,6 @@ parole_gst_expose_event (GtkWidget *widget, GdkEventExpose *ev)
 	parole_gst_draw_logo (gst);
     else 
     {
-	TRACE ("Exposing GST");
 	gst_x_overlay_expose (GST_X_OVERLAY (gst->priv->video_sink));
     }
 	
@@ -1404,7 +1425,6 @@ parole_gst_button_release_event (GtkWidget *widget, GdkEventButton *ev)
     {
 	nav = GST_NAVIGATION (gst->priv->video_sink);
 	gst_navigation_send_mouse_event (nav, "mouse-button-release", ev->button, ev->x, ev->y);
-	ret = TRUE;
     }
     
     if (GTK_WIDGET_CLASS (parole_gst_parent_class)->button_release_event)
diff --git a/parole/parole-player.c b/parole/parole-player.c
index a933e5a..44b9ad9 100644
--- a/parole/parole-player.c
+++ b/parole/parole-player.c
@@ -1142,7 +1142,7 @@ static gboolean
 parole_player_gst_widget_button_release (GtkWidget *widget, GdkEventButton *ev, ParolePlayer *player)
 {
     gboolean ret_val = FALSE;
-    
+
     if ( ev->button == 3 )
     {
 	parole_player_show_menu (player, ev->button, ev->time);
@@ -1152,7 +1152,6 @@ parole_player_gst_widget_button_release (GtkWidget *widget, GdkEventButton *ev,
     else if ( ev->button == 1 )
     {
 	gtk_widget_grab_focus (widget);
-	ret_val = TRUE;
     }
     
     return ret_val;



More information about the Xfce4-commits mailing list