totem r6262 - in trunk: . src/backend
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: totem r6262 - in trunk: . src/backend
- Date: Wed, 15 Apr 2009 12:19:00 +0000 (UTC)
Author: pwithnall
Date: Wed Apr 15 12:19:00 2009
New Revision: 6262
URL: http://svn.gnome.org/viewvc/totem?rev=6262&view=rev
Log:
2009-04-15 Philip Withnall <philip tecnocode co uk>
* src/backend/bacon-video-widget-gst-0.10.c
(bacon_video_widget_realize), (bacon_video_widget_init):
* src/backend/bacon-video-widget-xine.c
(bacon_video_widget_realize): Remainders of the patches below to
use GtkWidget accessors in BaconVideoWidget, which changes how Bvw's
GdkWindows are created. (Closes: #578591)
Modified:
trunk/ChangeLog
trunk/src/backend/bacon-video-widget-gst-0.10.c
trunk/src/backend/bacon-video-widget-xine.c
Modified: trunk/src/backend/bacon-video-widget-gst-0.10.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-gst-0.10.c (original)
+++ trunk/src/backend/bacon-video-widget-gst-0.10.c Wed Apr 15 12:19:00 2009
@@ -500,26 +500,17 @@
GdkWindowAttr attributes;
gint attributes_mask, w, h;
GdkColor colour;
+ GdkWindow *window;
+ GdkEventMask event_mask;
- /* Creating our widget's window */
- attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
- attributes.event_mask = gtk_widget_get_events (widget);
- attributes.event_mask |= GDK_EXPOSURE_MASK |
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_KEY_PRESS_MASK;
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+ event_mask = gtk_widget_get_events (widget)
+ | GDK_POINTER_MOTION_MASK
+ | GDK_KEY_PRESS_MASK;
+ gtk_widget_set_events (widget, event_mask);
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
- gdk_window_set_user_data (widget->window, widget);
+ GTK_WIDGET_CLASS (parent_class)->realize (widget);
+
+ window = gtk_widget_get_window (widget);
/* Creating our video window */
attributes.window_type = GDK_WINDOW_CHILD;
@@ -535,18 +526,19 @@
GDK_KEY_PRESS_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y;
- bvw->priv->video_window = gdk_window_new (widget->window,
+ bvw->priv->video_window = gdk_window_new (window,
&attributes, attributes_mask);
gdk_window_set_user_data (bvw->priv->video_window, widget);
gdk_color_parse ("black", &colour);
gdk_colormap_alloc_color (gtk_widget_get_colormap (widget),
&colour, TRUE, TRUE);
- gdk_window_set_background (widget->window, &colour);
- widget->style = gtk_style_attach (widget->style, widget->window);
+ gdk_window_set_background (window, &colour);
+ gtk_widget_set_style (widget,
+ gtk_style_attach (gtk_widget_get_style (widget), window));
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
+
/* Connect to configure event on the top level window */
g_signal_connect (G_OBJECT (gtk_widget_get_toplevel (widget)),
"configure-event", G_CALLBACK (bacon_video_widget_configure_event), bvw);
@@ -1078,8 +1070,6 @@
GTK_WIDGET_SET_FLAGS (GTK_WIDGET (bvw), GTK_CAN_FOCUS);
GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (bvw), GTK_DOUBLE_BUFFERED);
- gtk_event_box_set_visible_window (GTK_EVENT_BOX (bvw), TRUE);
-
bvw->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (bvw, BACON_TYPE_VIDEO_WIDGET, BaconVideoWidgetPrivate);
bvw->com = g_new0 (BaconVideoWidgetCommon, 1);
Modified: trunk/src/backend/bacon-video-widget-xine.c
==============================================================================
--- trunk/src/backend/bacon-video-widget-xine.c (original)
+++ trunk/src/backend/bacon-video-widget-xine.c Wed Apr 15 12:19:00 2009
@@ -1159,9 +1159,10 @@
static void
bacon_video_widget_realize (GtkWidget *widget)
{
- GdkWindowAttr attr;
GdkColor black;
BaconVideoWidget *bvw;
+ GdkWindow *window;
+ GdkEventMask event_mask;
bvw = BACON_VIDEO_WIDGET (widget);
if (bvw->priv->type != BVW_USE_TYPE_VIDEO)
@@ -1170,32 +1171,26 @@
return;
}
- /* set realized flag */
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
- /* Create the widget's window */
- attr.x = widget->allocation.x;
- attr.y = widget->allocation.y;
- attr.width = widget->allocation.width;
- attr.height = widget->allocation.height;
- attr.window_type = GDK_WINDOW_CHILD;
- attr.wclass = GDK_INPUT_OUTPUT;
- attr.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK
+ event_mask = gtk_widget_get_events (widget)
| GDK_POINTER_MOTION_MASK
- | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK;
- widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attr, GDK_WA_X | GDK_WA_Y);
- gdk_window_show (widget->window);
+ | GDK_KEY_PRESS_MASK;
+ gtk_widget_set_events (widget, event_mask);
+
+ GTK_WIDGET_CLASS (parent_class)->realize (widget);
/* Flush, so that the window is really shown */
gdk_flush ();
- gdk_window_set_user_data (widget->window, bvw);
+
+ window = gtk_widget_get_window (widget);
gdk_color_parse ("Black", &black);
gdk_colormap_alloc_color (gtk_widget_get_colormap (widget),
&black, TRUE, TRUE);
- gdk_window_set_background (widget->window, &black);
- widget->style = gtk_style_attach (widget->style, widget->window);
+ gdk_window_set_background (window, &black);
+ gtk_widget_set_style
+ (widget,
+ gtk_style_attach (gtk_widget_get_style (widget), window));
/* track configure events of toplevel window */
g_signal_connect (G_OBJECT (gtk_widget_get_toplevel (widget)),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]