|
10 | 10 | import tkinter as tk
|
11 | 11 | from collections import abc
|
12 | 12 | from math import log10, ceil
|
13 |
| -from subprocess import CREATE_NO_WINDOW |
14 | 13 | from tkinter.font import Font, nametofont
|
15 | 14 | from functools import partial, cached_property
|
16 | 15 | from datetime import datetime, timedelta, timezone
|
17 | 16 | from tkinter import Tk, ttk, StringVar, DoubleVar, IntVar, PhotoImage
|
18 | 17 | from typing import Any, Union, Tuple, TypedDict, NoReturn, Generic, TYPE_CHECKING
|
19 | 18 |
|
| 19 | +if sys.platform == "win32": |
| 20 | + from subprocess import CREATE_NO_WINDOW |
| 21 | + |
20 | 22 | import pystray
|
21 | 23 | import win32api
|
22 | 24 | import win32con
|
@@ -497,14 +499,16 @@ async def ask_login(self) -> str:
|
497 | 499 | options.add_argument(f"--proxy-server={self._manager._twitch.settings.proxy}")
|
498 | 500 | options.set_capability("pageLoadStrategy", "eager")
|
499 | 501 | try:
|
| 502 | + kwargs = {} |
| 503 | + if sys.platform == "win32": |
| 504 | + kwargs["service_creationflags"] = CREATE_NO_WINDOW |
500 | 505 | driver_coro = loop.run_in_executor(
|
501 | 506 | None,
|
502 | 507 | lambda: Chrome(
|
503 | 508 | options=options,
|
504 | 509 | suppress_welcome=True,
|
505 | 510 | version_main=version_main,
|
506 |
| - service_creationflags=CREATE_NO_WINDOW, |
507 |
| - # user_data_dir=str(CACHE_PATH.joinpath("ChromeProfile")), |
| 511 | + **kwargs, |
508 | 512 | )
|
509 | 513 | )
|
510 | 514 | driver = await self._manager.coro_unless_closed(driver_coro)
|
|
0 commit comments