[kupfer: 10/53] uievents: Implement environment.get_display



commit cfefc9e95f6b3f5d066e6a6d7333c2b1ed6a3444
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Mar 24 17:22:33 2011 +0100

    uievents: Implement environment.get_display

 kupfer/ui/uievents.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/ui/uievents.py b/kupfer/ui/uievents.py
index cb7702c..a7ceb36 100644
--- a/kupfer/ui/uievents.py
+++ b/kupfer/ui/uievents.py
@@ -16,7 +16,18 @@ class GUIEnvironmentContext (object):
 	def get_timestamp(self):
 		return self._timestamp
 	def get_startup_notification_id(self):
+		"""
+		Always returns a byte string
+		"""
 		return _make_startup_notification_id(self.get_timestamp())
+	def get_display(self):
+		"""return the display name to show new windows on
+
+		Always returns a byte string
+		"""
+		# FIXME: use Kupfer window's display
+		return os.getenv("DISPLAY", ":0")
+
 
 class _internal_data (object):
 	seq = 0



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