Fix screenshot code
Thomas Ross
3 years ago
2820 | 2820 | height = Gdk.Screen.height() |
2821 | 2821 | else: |
2822 | 2822 | (x, y, width, height) = xmouse.geometry() |
2823 | pix = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, width, height) | |
2824 | pix = pix.get_from_drawable( | |
2825 | root_win, Gdk.colormap_get_system(), x, y, 0, 0, width, height | |
2826 | ) | |
2823 | pix = Gdk.pixbuf_get_from_window(root_win, x, y, width, height) | |
2827 | 2824 | # Save as /tmp/mirage-<random>/filename.ext |
2828 | 2825 | tmpdir = tempfile.mkdtemp(prefix="mirage-") + "/" |
2829 | 2826 | tmpfile = tmpdir + "screenshot.png" |