summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-21 18:40:13 +0000
committerjstebbins <[email protected]>2010-04-21 18:40:13 +0000
commitd14d10a3d6e714dc312fd2d629d352b423623f7d (patch)
treebac03ba38d1b996e9619ccd4629725d1f766b497 /gtk
parent25b0459d8baee62caa2fa28fe7560b5d870a0699 (diff)
LinGui: fix possible live preview failure with gtk 2.18
according to the doc's you must call gdk_window_ensure_native() before getting the X11 XID for the window. this is the only way to guarantee that the window is native and has an XID. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3249 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/preview.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 4ed717bb1..fc713f6d2 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -164,6 +164,18 @@ ghb_preview_init(signal_user_data_t *ud)
GstBus *bus;
GstElement *xover;
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!gdk_window_ensure_native(ud->preview->view->window))
+ {
+ g_message("Couldn't create native window for GstXOverlay. Disabling live preview.");
+ GtkWidget *widget = GHB_WIDGET(ud->builder, "live_preview_box");
+ gtk_widget_hide (widget);
+ widget = GHB_WIDGET(ud->builder, "live_preview_duration_box");
+ gtk_widget_hide (widget);
+ return;
+ }
+#endif
+
#if !defined(_WIN32)
ud->preview->xid = GDK_DRAWABLE_XID(ud->preview->view->window);
#else
@@ -175,6 +187,7 @@ ghb_preview_init(signal_user_data_t *ud)
xover = gst_element_factory_make("gconfvideosink", "xover");
if (ud->preview->play == NULL || xover == NULL)
{
+ g_message("Couldn't initialize gstreamer. Disabling live preview.");
GtkWidget *widget = GHB_WIDGET(ud->builder, "live_preview_box");
gtk_widget_hide (widget);
widget = GHB_WIDGET(ud->builder, "live_preview_duration_box");