Skip to content

Commit dab2599

Browse files
committed
fix: add comments for Gtk2/3-workarounds in OpenCV window handling
1 parent 37738e8 commit dab2599

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/extract_otp_secrets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ def extract_otps_from_camera(args: Args) -> Otps:
390390

391391
cv2.imshow(WINDOW_NAME, img)
392392
except cv2.error as e:
393+
# Workaround due to Gtk2/3 problem, see #444
393394
if e.code == cv2.Error.StsNullPtr:
394395
# Window closed
395396
break
@@ -510,6 +511,7 @@ def cv2_handle_pressed_keys(qr_mode: QRMode, otps: Otps) -> Tuple[bool, QRMode]:
510511
elif key == 32:
511512
qr_mode = next_valid_qr_mode(qr_mode, zbar_available)
512513
if verbose >= LogLevel.MORE_VERBOSE: print(f"QR reading mode: {qr_mode}")
514+
# Do not check for invisible window due to Gtk2/3 problem, see #444
513515
return quit, qr_mode
514516

515517

0 commit comments

Comments
 (0)