[kupfer: 43/51] ui: Hold a reference to the current GdkScreen



commit c6f6655a1d6b16ac283fdbfd35eb376e2c50c868
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Mar 28 16:51:49 2011 +0200

    ui: Hold a reference to the current GdkScreen
    
    A crashing bug in AsyncCommand (Send to Command...) bisected to the
    commit 'ui: Use uievents to open and close displays'. Unknown why, we
    need to keep a reference to the GdkScreen we are using to avoid the
    crash.
    
    Thanks to git bisect.

 kupfer/ui/browser.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/ui/browser.py b/kupfer/ui/browser.py
index ef5b604..744cb09 100644
--- a/kupfer/ui/browser.py
+++ b/kupfer/ui/browser.py
@@ -1747,6 +1747,7 @@ class WindowController (pretty.OutputMixin):
 		self.window = KupferWindow(gtk.WINDOW_TOPLEVEL)
 		self.window.add_events(gtk.gdk.BUTTON_PRESS_MASK)
 		self.current_screen_handler = 0
+		self.current_screen = None
 
 		data_controller = data.DataController()
 		data_controller.connect("launched-action", self.launch_callback)
@@ -1986,6 +1987,7 @@ class WindowController (pretty.OutputMixin):
 			self.window.set_screen(screen)
 		self.current_screen_handler = \
 			screen.connect("monitors-changed", self._monitors_changed)
+		self.current_screen = screen
 
 	def _center_window(self, displayname=None):
 		"""Center Window on the monitor the pointer is currently on"""
@@ -1995,7 +1997,7 @@ class WindowController (pretty.OutputMixin):
 				return name + ".0"
 			return name
 		if not displayname and self.window.has_screen():
-			display = self.window.get_screen().get_display()
+			display = self.window.get_display()
 		else:
 			display = uievents.GUIEnvironmentContext.ensure_display_open(displayname)
 		screen, x, y, modifiers = display.get_pointer()



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