mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -05:00
Use macos_helper.disable_appnap at startup
This commit is contained in:
parent
2d4de33cf3
commit
8b26399456
1 changed files with 4 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ from anki.utils import (
|
||||||
split_fields,
|
split_fields,
|
||||||
)
|
)
|
||||||
from aqt import gui_hooks
|
from aqt import gui_hooks
|
||||||
|
from aqt._macos_helper import macos_helper
|
||||||
from aqt.addons import DownloadLogEntry, check_and_prompt_for_updates, show_log_to_user
|
from aqt.addons import DownloadLogEntry, check_and_prompt_for_updates, show_log_to_user
|
||||||
from aqt.dbcheck import check_db
|
from aqt.dbcheck import check_db
|
||||||
from aqt.debug_console import show_debug_console
|
from aqt.debug_console import show_debug_console
|
||||||
|
|
@ -1718,6 +1719,9 @@ title="{}" {}>{}</button>""".format(
|
||||||
self.hideMenuAccels = True
|
self.hideMenuAccels = True
|
||||||
self.maybeHideAccelerators()
|
self.maybeHideAccelerators()
|
||||||
self.hideStatusTips()
|
self.hideStatusTips()
|
||||||
|
# prevent App Nap from suspending Anki in the background
|
||||||
|
if macos_helper:
|
||||||
|
macos_helper.disable_appnap()
|
||||||
elif is_win:
|
elif is_win:
|
||||||
self._setupWin32()
|
self._setupWin32()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue