From 2f1691f9d216de9424a91b07d488aa531ea54b97 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 8 Dec 2021 21:16:21 +0100 Subject: [PATCH] xsecurelock: reduce code duplication --- bin/xsecurelock-saver | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/xsecurelock-saver b/bin/xsecurelock-saver index ac06c09..be50b5a 100755 --- a/bin/xsecurelock-saver +++ b/bin/xsecurelock-saver @@ -106,11 +106,6 @@ if __name__ == "__main__": ctx.background = None ctx.position = [0, 0] - try: - ctx.background = GdkPixbuf.Pixbuf.new_from_file(ctx.background_image) - except Exception: - pass - ctx.window = Gtk.Window() ctx.window.set_app_paintable(True) ctx.window.set_visual(ctx.window.get_screen().get_rgba_visual()) @@ -127,6 +122,7 @@ if __name__ == "__main__": gfile = Gio.File.new_for_path(ctx.background_image) monitor = gfile.monitor_file(Gio.FileMonitorFlags.WATCH_MOVES, None) monitor.connect("changed", on_background_change, ctx) + on_background_change(None, None, None, Gio.FileMonitorEvent.CHANGES_DONE_HINT, ctx) ctx.window.show_all()