Skip to content

Commit 8a83d2e

Browse files
committed
Support HiDPI awareness on Windows
1 parent 06a8a16 commit 8a83d2e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

slip39/gui/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ def main( argv=None ):
10911091
default=None,
10921092
help="Encrypt the master secret w/ this passphrase, '-' reads it from stdin (default: None/'')" )
10931093
ap.add_argument( '-s', '--scaling',
1094-
default=None, type=float,
1094+
default=1, type=float,
10951095
help="Scaling for display (eg. 1.5, 0.5 for high-resolution displays), if not automatically detected")
10961096
ap.add_argument( 'names', nargs="*",
10971097
help="Account names to produce")
@@ -1104,6 +1104,12 @@ def main( argv=None ):
11041104
if args.verbose:
11051105
logging.getLogger().setLevel( log_cfg['level'] )
11061106

1107+
if sys.platform == 'win32':
1108+
# Establishes a common baseline size on macOS and Windows, as long as
1109+
# SetProcessDpiAwareness( 1 ) is set, and scaling == 1.0. Ignored on macOS.
1110+
from ctypes import windll
1111+
windll.shcore.SetProcessDpiAwareness(1)
1112+
11071113
try:
11081114
app(
11091115
names = args.names,

0 commit comments

Comments
 (0)