From af7fae6c448f033307074fcb7f34e2dc2281b5c2 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 13 Sep 2021 21:04:33 -0700 Subject: [PATCH] Don't show qrcode until geometry is ready. --- showqr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/showqr.py b/showqr.py index bf67187..0b70b5c 100644 --- a/showqr.py +++ b/showqr.py @@ -24,6 +24,7 @@ def showqr_argparse(args): image = qrcode.make(text).get_image() root = tkinter.Tk() + root.withdraw() root.title("QR code") root.bind('', lambda *args, **kwargs: root.quit()) root.bind('', lambda *args, **kwargs: save_image(root, image)) @@ -38,6 +39,7 @@ def showqr_argparse(args): y_offset = (root.winfo_screenheight() - height) / 2 root.geometry('%dx%d+%d+%d' % (width, height, x_offset, y_offset-50)) + root.deiconify() root.mainloop() return 0