Make pygtk 2.14 failures more graceful
This commit is contained in:
parent
0b3cb3df9b
commit
63a17a88b4
@ -1661,6 +1661,7 @@ text/plain
|
||||
# Center it over the current terminal (not perfect?!?)
|
||||
# This could be replaced by a less bothersome dialog, but then that would
|
||||
# center over the window, not the terminal
|
||||
try:
|
||||
screen_w = gtk.gdk.screen_width()
|
||||
screen_h = gtk.gdk.screen_height()
|
||||
local_x, local_y = self.allocation.x, self.allocation.y
|
||||
@ -1672,6 +1673,9 @@ text/plain
|
||||
new_x = min(max(0, x+(local_w/2)-(win.allocation.width/2)), screen_w-win.allocation.width)
|
||||
new_y = min(max(0, y+(local_h/2)-(win.allocation.height/2)), screen_h-win.allocation.height)
|
||||
win.move(new_x, new_y)
|
||||
except AttributeError:
|
||||
# Old pygtk has no gtk.Widget.get_window()
|
||||
pass
|
||||
|
||||
win.show_all ()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user