Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

epic: disable the EOS overlay by default, add SOJU_KEYLOG for stuck-key reports

mikey9298d5bc7b1cb2
diff --git a/README.ko.md b/README.ko.md
index a23b1ba1c1a..71a2616d375 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -128,6 +128,7 @@ GPTK 안의 `libd3dshared.dylib`는 그래픽만이 아닙니다. **D2R 로더(
- **배틀넷 로그인 화면이 가끔 깜빡임(~1분 1회)** → 알려진 외관 이슈이며 자동으로 복구됩니다.
- **언리얼 엔진 게임 시작 시 "AMD graphics driver has known issues" 경고**(Hogwarts Legacy 등): D3DMetal이 자신을 구형 드라이버의 AMD 카드로 소개해 UE4의 드라이버 검사가 걸리는 것입니다. 무해하며 OK로 넘어가면 됩니다. 없애려면 게임의 사용자 `Engine.ini`(`AppData/Local/<게임>/Saved/Config/WindowsNoEditor/`)에 `[SystemSettings]` / `r.WarnOfBadDrivers=0`을 추가하세요.
- **GOG GALAXY: 알림 토스트가 뜨는 동안 오른쪽 아래가 검은 사각형으로 가려짐**, 토스트가 사라지면 함께 사라짐. 토스트는 GOG 알림 렌더러의 투명 레이어 창인데 Wine에는 DWM 합성이 없어 투명 영역이 검게 칠해집니다. 무해하며, GOG 설정에서 데스크톱 알림을 끄면 안 뜹니다.
+- **이동키가 눌린 채로 고정되거나, 마우스는 되는데 키보드가 죽는 경우** (Hogwarts Legacy에서 확인): 키를 누른 사이에 키보드 포커스가 다른 Wine 창으로 넘어간 것입니다. 주범은 Epic(EOS) 오버레이라 `soju epic`은 이제 오버레이를 끕니다(`SOJU_EPIC_OVERLAY=1`로 복구, 적용하려면 `soju epic-kill` 후 재실행). 입력 소스는 세션 내내 영어(ABC)로 두세요. 게임 중 전환 자체가 포커스 이탈입니다. 그래도 재발하면 `SOJU_KEYLOG=1 soju epic`이 `~/.battlenet-macos/logs/`에 키·포커스 로그를 남기니 이슈에 첨부해 주세요.
- **Epic: "your account has too many active logins"**, 모든 기기에서 로그아웃하거나 비밀번호를 재설정해도 그대로인 경우. 서버가 실제로 답하는 것은 `too_many_sessions`(18048)이고, 이는 보유 중인 세션이 아니라 *발급된* 세션 수에 대한 제한이라 재시도할수록 나빠진다. 예전 엔진에서는 런처의 기기 키를 wine이 저장하지 못해 몇 번만 실행해도 걸렸다(`patches/ncrypt-persisted-keys.patch` 참고). 보틀을 끄고(`soju epic-kill`) 몇 시간 두어 카운터가 비워진 뒤 한 번만 실행하세요.
- **BLZBNTBNA00000005** → `play.sh`가 서명된 exe를 자동으로 넣어 줍니다.
diff --git a/README.md b/README.md
index b3dad346f9f..c4e8bd5e882 100644
--- a/README.md
+++ b/README.md
@@ -133,6 +133,7 @@ Start with `soju doctor`: it checks most of the items below and tells you which
- **Battle.net login webview may flicker (~once a minute)** -> known cosmetic issue; it recovers automatically and login works.
- **"The installed version of the AMD graphics driver has known issues" when an Unreal Engine game starts** (Hogwarts Legacy and others): D3DMetal presents itself as an AMD adapter with an old driver version, so UE4's driver check fires. Harmless, click OK; to silence it add `[SystemSettings]` / `r.WarnOfBadDrivers=0` to the game's user `Engine.ini` (under `AppData/Local/<Game>/Saved/Config/WindowsNoEditor/`).
- **GOG GALAXY: a black rectangle appears at the bottom right while a notification toast is shown** and disappears with it. The toast is a transparent layered window from GOG's notifications renderer; without DWM composition Wine paints its transparent area black. Harmless. Turning off desktop notifications in GOG's settings avoids it.
+- **A movement key stays pressed, or the keyboard goes dead while the mouse still works** (seen in Hogwarts Legacy): keyboard focus moved to another Wine window while the key was held. The usual culprit is the Epic (EOS) overlay, which is why `soju epic` now disables it (`SOJU_EPIC_OVERLAY=1` brings it back; restart the launcher with `soju epic-kill` for the change to apply). Keep the macOS input source on English (ABC) for the whole session, switching it mid-game is itself a focus change. Still happening? `SOJU_KEYLOG=1 soju epic` writes a key/focus trace to `~/.battlenet-macos/logs/` to attach to an issue.
- **Epic: "your account has too many active logins"** and logging out everywhere or resetting the password does not help. The account service is really answering `too_many_sessions` (18048), a limit on how many sessions were *issued*, not how many are held, so retrying makes it worse. Older engines hit this within a handful of launches because Wine could not keep the launcher's device key: see `patches/ncrypt-persisted-keys.patch`. Stop the bottle (`soju epic-kill`), leave it alone for a few hours so the counter clears, then start it once.
- **BLZBNTBNA00000005** -> `play.sh` seeds the signed exe automatically; make sure you launch through it.
diff --git a/README.zh.md b/README.zh.md
index c3f0069ae79..668c5f89c40 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -133,6 +133,7 @@ scripts/play.sh steam-kill # 停止 Steam bottle
- **战网登录 webview 偶尔闪烁(约一分钟一次)** -> 已知的外观问题;会自动恢复,不影响登录。
- **虚幻引擎游戏启动时提示 "The installed version of the AMD graphics driver has known issues"**(《霍格沃茨之遗》等):D3DMetal 把自己伪装成旧驱动版本的 AMD 显卡,触发了 UE4 的驱动检查。无害,点确定即可;想彻底关掉就在游戏的用户 `Engine.ini`(`AppData/Local/<游戏>/Saved/Config/WindowsNoEditor/` 下)加入 `[SystemSettings]` / `r.WarnOfBadDrivers=0`。
- **GOG GALAXY:通知弹出时右下角出现黑色矩形**,随通知一起消失。通知是 GOG 通知渲染器的透明分层窗口;没有 DWM 合成时 Wine 会把透明区域涂黑。无害。在 GOG 设置里关闭桌面通知即可避免。
+- **移动键卡在按下状态,或者鼠标正常但键盘完全没反应**(在 Hogwarts Legacy 中出现过):按住键的时候键盘焦点被另一个 Wine 窗口抢走了。常见元凶是 Epic(EOS)覆盖层,所以 `soju epic` 现在默认禁用它(`SOJU_EPIC_OVERLAY=1` 可恢复;先 `soju epic-kill` 再重启登录器才会生效)。整个游戏过程保持 macOS 输入法为英文(ABC),游戏中切换输入法本身就是一次焦点切换。仍然复现?`SOJU_KEYLOG=1 soju epic` 会把按键和焦点日志写到 `~/.battlenet-macos/logs/`,提 issue 时附上。
- **Epic 提示 "your account has too many active logins"**,而且在所有设备退出登录、甚至重置密码后依旧如此。账号服务实际返回的是 `too_many_sessions`(18048),限制的是*已发放*的会话数量而非当前持有的数量,所以反复重试只会更糟。旧引擎上启动几次就会触发,因为 Wine 无法保存登录器的设备密钥,详见 `patches/ncrypt-persisted-keys.patch`。先停掉 bottle(`soju epic-kill`),放置几个小时等计数器清零,然后只启动一次。
- **BLZBNTBNA00000005** -> `play.sh` 会自动播种签名 exe;请确认是通过它启动的。
diff --git a/docs/DIAGNOSIS.md b/docs/DIAGNOSIS.md
index 75a8180cf96..c69349beebf 100644
--- a/docs/DIAGNOSIS.md
+++ b/docs/DIAGNOSIS.md
@@ -180,6 +180,35 @@ else if (type == NSEventTypeKeyUp)
엔진 빌드와 런처 구동은 확인했다(GOG 정상 실행, 독 아이콘·커스텀 프레임 패치도 함께 적용된 바이너리).
게임에서 실제로 고정 현상이 사라지는지는 플레이로 확인해야 한다.
+### 패치 이후에도 재발 (2026-09-01): EOS 오버레이가 유력
+
+패치가 들어간 엔진(winemac.so에 `releasePressedKeys` 심볼 확인)으로 호그와트를 플레이했는데도
+W 고정이 계속됐고, 동시에 **마우스는 되는데 키보드가 전부 죽는** 증상이 같이 나왔다.
+
+이 조합이 원인을 가리킨다. Wine은 마우스 입력은 커서 아래 창으로, 키보드 입력은 foreground 창으로
+보낸다. 키보드만 죽었다는 것은 foreground가 게임 창이 아닌 다른 창으로 넘어갔다는 뜻이고, 그
+순간 W가 눌려 있었다면 key up은 그 다른 창으로 가서 게임은 영영 뗀 사실을 모른다. UE4는 창
+비활성화(`WM_ACTIVATE`)를 받으면 눌린 키를 스스로 비우므로(`FlushPressedKeys`), 게임 창에는
+비활성화 통지도 오지 않은 채 키보드 포커스만 빠져나간 경우다. 위 패치는 macOS 앱 단위의 포커스
+이탈(`applicationDidResignActive:`)에서만 동작하므로, **같은 프로세스 안에서** 포커스가 옮겨간
+경우는 다루지 못한다.
+
+같은 프로세스 안에 창을 만드는 것은 EOS 오버레이다. EOS SDK가 게임 프로세스에
+`EOSOVH-Win64-Shipping.dll`을 로드하고, 옆에 `EOSOverlayRenderer-Win64-Shipping.exe`(CEF)
+프로세스 트리가 뜬다(게임 시작 약 30초 뒤 6개 확인). 업적·친구 알림 토스트가 뜰 때마다 창이
+생기고 포커스를 건드린다. 어제 세션의 renderer 프로세스가 고아로 남아 있는 것도 확인했다
+(wineserver가 살아 있어 reaper 대상이 아니었다).
+
+조치: `play.sh epic`에서 `WINEDLLOVERRIDES=EOSOVH-Win64-Shipping,EOSOVH-Win32-Shipping=d`로
+오버레이 DLL 로드를 막는다(Steam 보틀의 `gameoverlayrenderer=d`와 같은 방식). 절대 경로 로드에도
+override가 적용되는 것은 regsvr32로 확인했다. `SOJU_EPIC_OVERLAY=1`로 되돌릴 수 있다.
+
+확인 방법: `soju epic-kill` 후 재실행해서 `EOSOverlayRenderer` 프로세스가 더 이상 뜨지 않는지 보고,
+플레이 중 두 증상이 함께 사라지면 확정. 그래도 재발하면 `SOJU_KEYLOG=1 soju epic`으로
+`~/.battlenet-macos/logs/keys-epic-*.log`를 남겨 W의 `KEY_RELEASE`가 어느 hwnd로 갔는지 본다.
+입력 소스는 게임 전에 영어(ABC)로 두고 게임 중에는 바꾸지 않는다. 입력 소스 전환 자체가
+포커스 이탈 트리거다.
+
## 켜둔 런처가 먹통이 되는 이유: wineserver를 잃은 고아 프로세스 (2026-08-31)
### 증상
diff --git a/scripts/play.sh b/scripts/play.sh
index 4a698925091..7cf72cbc8ea 100755
--- a/scripts/play.sh
+++ b/scripts/play.sh
@@ -29,6 +29,18 @@ else
fi
export WINEDEBUG="${WINEDEBUG:-fixme-all}"
+# SOJU_KEYLOG=1: record every key event the Mac driver sees and every focus
+# change, to ~/.battlenet-macos/logs/keys-<mode>-<time>.log. For "a key stays
+# pressed" / "keyboard dead, mouse fine" reports: the log shows which window a
+# KEY_RELEASE went to. Noisy (mouse moves too); leave it off otherwise.
+if [[ "${SOJU_KEYLOG:-0}" == 1 ]]; then
+ mkdir -p "$HOME/.battlenet-macos/logs"
+ KEYLOG="$HOME/.battlenet-macos/logs/keys-$MODE-$(date +%Y%m%d-%H%M%S).log"
+ export WINEDEBUG="fixme-all,+key,+event"
+ exec 2>>"$KEYLOG"
+ echo "soju keylog $(date) mode=$MODE prefix=$WINEPREFIX" >&2
+ echo "soju: key log -> $KEYLOG"
+fi
export WINEMSYNC=1
export ROSETTA_ADVERTISE_AVX=1
# Battle.net's CEF renderer CHECKs that VirtualProtect() on a written .data page
@@ -97,6 +109,20 @@ case "$MODE" in
# click therefore replays the tray double-click into the launcher instead
# (tools/soju-epic-restore.c, built by create-epic-bottle.sh).
export WINE_DOCK_REOPEN_CMD="'$ENGINE/bin/wine' '$HOME/.battlenet-macos/epic-support/soju-epic-restore.exe'"
+ # The EOS overlay (EOSOVH-*-Shipping.dll, loaded by the EOS SDK into every
+ # game, plus a CEF renderer tree beside it) is off by default, like Steam's
+ # gameoverlayrenderer. It draws inside the game's own process, so when one
+ # of its windows takes Wine's keyboard focus (a toast, an achievement) the
+ # game gets no deactivation: a movement key held at that moment stays down,
+ # and every key after it goes to the overlay while the mouse keeps working
+ # (mouse input follows the cursor, keyboard input follows the foreground
+ # window). Under Wine the overlay offers nothing but those toasts. Wine
+ # honours the override for a load by full path too (verified with
+ # regsvr32: "Failed to load DLL"). SOJU_EPIC_OVERLAY=1 turns it back on.
+ # A launcher already running keeps its old environment: soju epic-kill first.
+ if [[ "${SOJU_EPIC_OVERLAY:-0}" != 1 ]]; then
+ export WINEDLLOVERRIDES="${WINEDLLOVERRIDES:+$WINEDLLOVERRIDES;}EOSOVH-Win64-Shipping,EOSOVH-Win32-Shipping=d"
+ fi
EPIC="C:\\Program Files\\Epic Games\\Launcher\\Portal\\Binaries\\Win64\\EpicGamesLauncher.exe"
[[ -f "$WINEPREFIX/drive_c/Program Files/Epic Games/Launcher/Portal/Binaries/Win64/EpicGamesLauncher.exe" ]] || \
{ echo "Epic Games Launcher not found, run scripts/create-epic-bottle.sh first"; exit 1; }