Merge lp://staging/~chantra/terminator/python2.12-compat into lp://staging/terminator/trunk

Proposed by chantra
Status: Merged
Merge reported by: Chris Jones
Merged at revision: not available
Proposed branch: lp://staging/~chantra/terminator/python2.12-compat
Merge into: lp://staging/terminator/trunk
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~chantra/terminator/python2.12-compat
Reviewer Review Type Date Requested Status
Chris Jones (community) Approve
Review via email: mp+10334@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
chantra (chantra) wrote :

making trunk compatible with python-gtk 2.12

Revision history for this message
Chris Jones (cmsj) wrote :

Hand merged into trunk after landing epic-refactor. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'terminatorlib/terminatorterm.py'
2--- terminatorlib/terminatorterm.py 2009-08-04 11:58:05 +0000
3+++ terminatorlib/terminatorterm.py 2009-08-14 14:38:18 +0000
4@@ -43,6 +43,14 @@
5 error.run()
6 sys.exit (1)
7
8+
9+
10+def gtk_widget_get_window( widget ):
11+ if gtk.gtk_version >= (2, 14):
12+ return widget.get_window()
13+ return widget.window
14+
15+
16 class TerminatorTermTitle (gtk.EventBox):
17 wanted = None
18 _title = None
19@@ -407,6 +415,8 @@
20 self._titlebox.set_terminal_size (self._vte.get_column_count (), self._vte.get_row_count ())
21
22 def get_pixbuf(self, maxsize= None):
23+ if gtk.gtk_version < ( 2, 14 ):
24+ return self.terminator.icon_theme.load_icon (APP_NAME, 48, 0)
25 pixmap = self.get_snapshot()
26 (width, height) = pixmap.get_size()
27 pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
28@@ -1519,12 +1529,12 @@
29 item = gtk.MenuItem (_("Insert padded terminal number"))
30 item.connect ("activate", lambda menu_item: self.do_enumerate (pad=True))
31 widget.append (item)
32-
33+
34 def position_popup_group_menu(self, menu, widget):
35 screen_w = gtk.gdk.screen_width()
36 screen_h = gtk.gdk.screen_height()
37
38- widget_win = widget.get_window()
39+ widget_win = gtk_widget_get_window( widget )
40 widget_x, widget_y = widget_win.get_origin()
41 widget_w, widget_h = widget_win.get_size()
42
43@@ -1632,7 +1642,7 @@
44 screen_h = gtk.gdk.screen_height()
45 local_x, local_y = self.allocation.x, self.allocation.y
46 local_w, local_h = self.allocation.width, self.allocation.height
47- window_x, window_y = self.get_window().get_origin()
48+ window_x, window_y = gtk_widget_get_window(self).get_origin()
49 x = window_x + local_x
50 y = window_y + local_y
51 win.realize()