Roger / escrotum

Linux screen capture using pygtk, inspired by scrot
GNU General Public License v3.0
214 stars 22 forks source link

TypeError when using -s in i3wm #31

Closed BenoitAverty closed 8 years ago

BenoitAverty commented 8 years ago

Hi,

I'm running debian, python2.7.12 and i3 as a window manager.

When I use escrotum -s to capture a region, it works fine. However, when I want to capture a whole window, here's what I get as an error :

/usr/local/lib/python2.7/dist-packages/escrotum/main.py:240: GtkWarning: IA__gdk_x11_colormap_foreign_new: assertion 'xcolormap != None' failed
  pb = pb.get_from_drawable(window, window.get_colormap(), x, y, 0, 0,
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/escrotum/main.py", line 241, in screenshot
    width, height)
TypeError: Gdk.Pixbuf.get_from_drawable() argument 2 must be gtk.gdk.Colormap, not None
^CTraceback (most recent call last):
  File "/usr/local/bin/escrotum", line 9, in <module>
    load_entry_point('escrotum==0.2.1', 'console_scripts', 'escrotum')()
  File "/usr/local/lib/python2.7/dist-packages/escrotum/main.py", line 382, in run
    gtk.main()

Any Idea what the problem could be ?

ninewise commented 8 years ago

Same exception on Void Linux, with dwm as window manager.

Roger commented 8 years ago

Looks like the container windows don't have colormap set.. https://github.com/i3/i3/issues/2435

Roger commented 8 years ago

@BenoitAverty @NoctuaNivalis please try: https://github.com/Roger/escrotum/commit/c5340c9455d09bf7a398617832d9bb45f2b6474d

ninewise commented 8 years ago

@Roger looking good here, thanks.