Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ def OnInit(self):
# Set language stuff and update to last used language.
self.UpdateLanguage(config.language)

try:
from ctypes import OleDLL
# Turn on high-DPI awareness to make sure rendering is sharp on big
# monitors with font scaling enabled.
OleDLL('shcore').SetProcessDpiAwareness(1)
except AttributeError:
# We're on a non-Windows box.
pass
except OSError:
# exc.winerror is often E_ACCESSDENIED (-2147024891/0x80070005).
# This occurs after the first run, when the parameter is reset in the
# executable's manifest and then subsequent calls raise this exception
# See last paragraph of Remarks at
# [https://msdn.microsoft.com/en-us/library/dn302122(v=vs.85).aspx](https://msdn.microsoft.com/en-us/library/dn302122(v=vs.85).aspx)
pass

return True

#-----------------------------------------------------------------------
Expand Down Expand Up @@ -74,4 +90,4 @@ def UpdateLanguage(self, lang=None):

else:
pyfalog.debug("Cannot find langauge: " + lang)
self.locale = wx.Locale(wx.Locale.FindLanguageInfo(LocaleSettings.defaults['locale']).Language)
self.locale = wx.Locale(wx.Locale.FindLanguageInfo(LocaleSettings.defaults['locale']).Language)