~schnouki/smartbg

9f255727aa2585dace2aff5345c706e812bc725b — Thomas Jost 10 years ago 6a6a961
Also use GTK for drawing to the root window... Strange but apparently needed.
1 files changed, 8 insertions(+), 2 deletions(-)

M smartbg
M smartbg => smartbg +8 -2
@@ 80,7 80,13 @@ def set_wallpaper(pb):
    # Get a pixmap from the pixbuf
    (pm, mask) = pb.render_pixmap_and_mask()

    # Let the Xlib fun begin!
    # First draw with Gtk (or else things may fail strangely)
    win = gtk.gdk.get_default_root_window()
    win.set_back_pixmap(pm, False)
    win.clear()
    win.draw_pixbuf(None, pb, 0, 0, 0, 0, sw, sh)

    # Then let the Xlib fun begin!
    # This is largely inspired by feh and esetroot
    # (http://www.eterm.org/docs/view.php?doc=ref#trans)
    # Create a new display,


@@ 122,8 128,8 @@ def set_wallpaper(pb):
    xwin.clear_area()

    # And we're done!
    dpy.sync()
    dpy.set_close_down_mode(X.RetainPermanent)
    dpy.sync()
    dpy.close()

# Parse command-line