[pitivi] viewer: Disable GTK double buffering to prevent flickering and black images



commit 6f4c58ff0ebbdeed36473c0f0f5e1daf5c6a55f8
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Wed Sep 25 15:38:05 2013 -0400

    viewer: Disable GTK double buffering to prevent flickering and black images
    
    Fixes bug #708088 (viewer image sometimes disappears/becomes black)
    Fixes bug #596954 (flickering and black image while resizing the previewer)
    
    Also hide the internal ViewerWidget at startup until a pipeline is set,
    to prevent the user's wallpaper from showing up through the viewer.

 pitivi/viewer.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/viewer.py b/pitivi/viewer.py
index 6d5e248..e5e4192 100644
--- a/pitivi/viewer.py
+++ b/pitivi/viewer.py
@@ -189,7 +189,6 @@ class PitiviViewer(Gtk.VBox, Loggable):
         self.internal = ViewerWidget(self.app.settings)
         # Transformation boxed DISABLED
         # self.internal.init_transformation_events()
-        self.internal.show()
         self.aframe.add(self.internal)
         self.pack_start(self.aframe, True, True, 0)
 
@@ -202,7 +201,6 @@ class PitiviViewer(Gtk.VBox, Loggable):
         self.external_window.connect("delete-event", self._externalWindowDeleteCb)
         self.external_window.connect("configure-event", self._externalWindowConfigureCb)
         self.external_vbox = vbox
-        self.external_vbox.show_all()
 
         # Buttons/Controls
         bbox = Gtk.HBox()
@@ -268,9 +266,18 @@ class PitiviViewer(Gtk.VBox, Loggable):
             width += 110
             height = int(width / self.aframe.props.ratio)
             self.aframe.set_size_request(width, height)
-        self.show_all()
+
         self.buttons = bbox
         self.buttons_container = boxalign
+        # Prevent black frames and flickering while resizing or changing focus:
+        self.internal.set_double_buffered(False)
+        self.external.set_double_buffered(False)
+        # We keep the ViewerWidget hidden initially, or the desktop wallpaper
+        # would show through the non-double-buffered widget!
+        self.internal.set_no_show_all(True)
+        self.external.set_no_show_all(True)
+        self.show_all()
+        self.external_vbox.show_all()
 
     def setDisplayAspectRatio(self, ratio):
         """


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