Mask some incompatibilities with older gtk
This commit is contained in:
parent
103428d0e3
commit
81e00fca0b
@ -410,7 +410,10 @@ for %s (%s)' % (name, urlplugin.__class__.__name__))
|
||||
screen_w = gtk.gdk.screen_width()
|
||||
screen_h = gtk.gdk.screen_height()
|
||||
|
||||
widget_win = widget.get_window()
|
||||
if gtk.gtk_version >= (2, 14):
|
||||
widget_win = widget.get_window()
|
||||
else:
|
||||
widget_win = widget.window
|
||||
widget_x, widget_y = widget_win.get_origin()
|
||||
widget_w, widget_h = widget_win.get_size()
|
||||
|
||||
|
@ -130,6 +130,9 @@ def shell_lookup():
|
||||
|
||||
def widget_pixbuf(widget, maxsize=None):
|
||||
"""Generate a pixbuf of a widget"""
|
||||
if gtk.gtk_version > (2, 14):
|
||||
return(None)
|
||||
|
||||
pixmap = widget.get_snapshot()
|
||||
(width, height) = pixmap.get_size()
|
||||
pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, width, height)
|
||||
|
Loading…
Reference in New Issue
Block a user