Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-02-28 20:41:00 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-02-28 20:41:00 (GMT)
commit7ce21d47bd7ac982a84bd1271ce259b7b7e0e59d (patch)
treecaf06931842c739118e654b5fb1977bf5ddebef5
parent748275ca00c995f98a454fad533ed7673d578765 (diff)
Ensure video is realized before showing live video
-rw-r--r--shell/intro/glive.py13
-rw-r--r--shell/intro/intro.py14
2 files changed, 17 insertions, 10 deletions
diff --git a/shell/intro/glive.py b/shell/intro/glive.py
index b2126aa..b573659 100644
--- a/shell/intro/glive.py
+++ b/shell/intro/glive.py
@@ -148,14 +148,21 @@ class LiveVideoSlot(gtk.EventBox):
gtk.EventBox.__init__(self)
self.imagesink = None
+ self.playa = None
+ self._width = width
+ self._height = height
+
self.unset_flags(gtk.DOUBLE_BUFFERED)
self.connect('focus-in-event', self.focus_in)
self.connect('focus-out-event', self.focus_out)
self.connect("button-press-event", self._button_press_event_cb)
+ self.connect("expose-event", self._expose_event_cb)
- self.playa = Glive(self, width, height)
- self.playa.connect('new-picture', self._new_picture_cb)
- self.playa.connect('sink', self._new_sink_cb)
+ def _expose_event_cb(self, widget, event):
+ if not self.playa:
+ self.playa = Glive(self, self._width, self._height)
+ self.playa.connect('new-picture', self._new_picture_cb)
+ self.playa.connect('sink', self._new_sink_cb)
def _new_picture_cb(self, playa, pixbuf):
self.emit('pixbuf', pixbuf)
diff --git a/shell/intro/intro.py b/shell/intro/intro.py
index 327f052..47d9b38 100644
--- a/shell/intro/intro.py
+++ b/shell/intro/intro.py
@@ -32,8 +32,8 @@ from sugar.graphics import iconbutton
import colorpicker
-_VIDEO_WIDTH = 320
-_VIDEO_HEIGHT = 240
+_VIDEO_WIDTH = 640
+_VIDEO_HEIGHT = 480
class IntroImage(gtk.EventBox):
@@ -113,7 +113,7 @@ class VideoBox(hippo.CanvasBox, hippo.CanvasItem):
self._video_widget = hippo.CanvasWidget()
self._video_widget.props.widget = self._video
self.append(self._video_widget)
- self._video.play()
+ gobject.idle_add(self._video.play)
self._img = IntroImage()
self._img.set_size_request(_VIDEO_WIDTH, _VIDEO_HEIGHT)
@@ -207,15 +207,15 @@ class IntroBox(hippo.CanvasBox, hippo.CanvasItem):
self._video_box = VideoBox(xalign=hippo.ALIGNMENT_CENTER,
yalign=hippo.ALIGNMENT_START,
- padding_bottom=units.grid_to_pixels(1))
+ padding_bottom=units.grid_to_pixels(0.5))
self.append(self._video_box)
self._entry_box = EntryBox(xalign=hippo.ALIGNMENT_CENTER,
- padding_bottom=units.grid_to_pixels(1))
+ padding_bottom=units.grid_to_pixels(0.5))
self.append(self._entry_box)
self._color_box = ColorBox(xalign=hippo.ALIGNMENT_CENTER,
- padding_bottom=units.grid_to_pixels(1))
+ padding_bottom=units.grid_to_pixels(0.5))
self.append(self._color_box)
self._ok = iconbutton.IconButton(icon_name="theme:stock-forward",
@@ -252,7 +252,7 @@ class IntroWindow(gtk.Window):
self._intro_box.connect('ok', self._ok_cb)
self._canvas.set_root(self._intro_box)
self.add(self._canvas)
- self._canvas.show()
+ self._canvas.show_all()
def _ok_cb(self, widget, pixbuf, name, color):
self.hide()