[cheese] window: ensure the drawing area has a native X11 window



commit 545758023fe3ba850692a099078b015de356c0f7
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Sun Jul 12 08:08:26 2009 +0200

    window: ensure the drawing area has a native X11 window
    
    With the new client-side-window gtk+ widgets do not always have a
    native window anymore. We need an XID to give to GstXOverlay and embed
    video into the application. This temporarily works around the issue
    forcing a native window. Works around bug 588357

 src/cheese-window.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/cheese-window.c b/src/cheese-window.c
index 0b79c7c..e500e89 100644
--- a/src/cheese-window.c
+++ b/src/cheese-window.c
@@ -1673,6 +1673,13 @@ cheese_window_create_window (CheeseWindow *cheese_window)
   gtk_container_add (GTK_CONTAINER (cheese_window->countdown_frame_fullscreen), cheese_window->countdown_fullscreen);
 
   gtk_widget_realize (cheese_window->screen);
+  GdkWindow *win = gtk_widget_get_window (cheese_window->screen);
+  if (!gdk_window_ensure_native (win)) {
+    /* FIXME: this breaks offscreen stuff, we should really find
+     * another way to embed video that doesn't require an XID */
+    /* abort: no native window, no xoverlay, no cheese. */
+    g_error ("Could not create a native X11 window for the drawing area");
+  }
   gdk_window_set_back_pixmap (gtk_widget_get_window (cheese_window->screen), NULL, FALSE);
   gtk_widget_set_app_paintable (cheese_window->screen, TRUE);
   gtk_widget_set_double_buffered (cheese_window->screen, FALSE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]