[pitivi] pitivi: Remove our hard dependency to GdkX11
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] pitivi: Remove our hard dependency to GdkX11
- Date: Sun, 19 Oct 2014 09:21:55 +0000 (UTC)
commit 10d82cd5e13a06616d884d175a81ebcc4daf3880
Author: Brion Vibber <brion pobox com>
Date: Sat Oct 18 09:07:01 2014 -0700
pitivi: Remove our hard dependency to GdkX11
Allowing us to run without X11, as on Mac OS X
https://bugzilla.gnome.org/show_bug.cgi?id=738767
pitivi/application.py | 15 ++++++++++-----
pitivi/check.py | 5 -----
2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 54f9fc3..a000919 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -24,7 +24,6 @@
import os
from gi.repository import GObject
-from gi.repository import GdkX11
from gi.repository import Gio
from gi.repository import Gtk
@@ -133,10 +132,16 @@ class Pitivi(Gtk.Application, Loggable):
if self.gui:
# The app is already started and the window already created.
# Present the already existing window.
- # TODO: Use present() instead of present_with_time() when
- # https://bugzilla.gnome.org/show_bug.cgi?id=688830 is fixed.
- x11_server_time = GdkX11.x11_get_server_time(self.gui.get_window())
- self.gui.present_with_time(x11_server_time)
+ try:
+ # TODO: Use present() instead of present_with_time() when
+ # https://bugzilla.gnome.org/show_bug.cgi?id=688830 is fixed.
+ from gi.repository import GdkX11
+ x11_server_time = GdkX11.x11_get_server_time(self.gui.get_window())
+ self.gui.present_with_time(x11_server_time)
+ except ImportError:
+ # On Wayland or Quartz (Mac OS X) backend there is no GdkX11,
+ # so just use present() directly here.
+ self.gui.present()
# No need to show the welcome wizard.
return
self.createMainWindow()
diff --git a/pitivi/check.py b/pitivi/check.py
index f809432..f35f0d3 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -265,8 +265,3 @@ def initialize_modules():
Gst.init(None)
from gi.repository import GES
GES.init()
-
- # This is required because of:
- # https://bugzilla.gnome.org/show_bug.cgi?id=656314
- from gi.repository import GdkX11
- GdkX11 # noop
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]