Repository navigation
fix(mumu): resolve MuMu 12 multi-display foreground app and instance detection (#4) - #5
Merged
Merged
Conversation
…detection (#4) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…in DeviceHub Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4
Root Causes (MuMu 12 v5.x / v6.x, e.g.
6.4.6.0on127.0.0.1:16416)Multi-display virtual screen (
app_keptlive/ game tab mode)displayId=2, portrait761x1376) whiledisplayId=0remains onapp.lawnchair/.LawnchairLauncherwithmCurrentFocus=null.scrcpy,adb input,screencap, rotation resolution, andwm sizepreviously targeted only primarydisplayId=0, showing the empty launcher instead of the active game.MuMu instance & window discovery (
-v <index>, elevatedMuMuVMMSVC, relocated VMs, helper windows)MuMuNxDevice.exepasses numeric-v 1/--vmindex 1on its command line, whileMuMuVMMHeadless.exeruns under theSYSTEMserviceMuMuVMMSVC(unreadable CLI from an un-elevated process).DetectMuMufell back toFirstMuMuVm(install, 0), returningnullwhenever instance0had been deleted or was not the running instance (leaving the emulator / window binding list empty).Changes (modeled on MaaFramework / MAA)
DisplayFocusParser,MuMuExternalRenderer)dumpsys windowstarting atWINDOW MANAGER DISPLAY CONTENTS(ignoring staleLAST ANRblocks) to resolve per-displaymCurrentFocus,mFocusedApp, resolution, DPI, andmTopFocusedDisplayId, prioritizing non-launcher foreground apps over launcher/system windows.external_renderer_ipc.dll(nx_device/{15.0,12.0}/shell/sdk/external_renderer_ipc.dll) vianemu_connect/nemu_get_display_id/nemu_capture_displayfor multi-tab tie-breaking and secondary-display capture fallback.ScrcpySession,AdbInputInjector,AdbService,DeviceHub)display_id=<id>toscrcpy-server4.1 and add in-placeScrcpySession.SwitchDisplay(int)with automatic fallback todisplayId=0when a game tab closes.adb input(tap,swipe,motionevent,keyevent,text) with-d <displayId>on Android 10+ (SDK >= 29), resolve per-display rotation, validatescreencap -d <id>PNG headers, and monitor active display/foreground app inDeviceHub.EmulatorCatalog,EmulatorConfigParsers,EmulatorDetector,WindowEnumerator,BindWindowDialog)-v <N>/--vmindex <N>/--index <N>, MAA's full port/index formulas (16384 + (i % 32) * 32 + (i / 32) * 4and inverseMuMuPortToIndex),MuMuManager.exe info/adb --vmindex allfallback (withmain_wndHWND matching), auxiliary Qt popup filtering (HintWnd,MessageWnd,*ToolSaveBits), and enriched window-binding / device / mirror / MCP (get_foreground_app) diagnostics.