moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
4.05k stars 644 forks source link

Immersive Mode malfunctioning on Android Nougat with physical Mouse/Keyboard #436

Closed The-Funk closed 6 years ago

The-Funk commented 7 years ago

Hello!

I'm using an Nvidia Shield 2017 that has been flashed with the mobile version of Android Nougat as opposed to Android TV, for configuration reasons. If anyone would like to duplicate this setup (it's pretty cool) I can recommend some steps.

Streaming quality with Moonlight (rooted) is great, audio is clean and USB passthrough is working okay with one weird little blip.

For whatever reason, my gaming mouse, even when it's not near the top or bottom of my monitor, if moved up or down, will sometimes trigger the shield to display the android status bar at the top of the screen and the launcher bar at the bottom, effectively taking the app out of "immersive mode". This does not happen when the mouse is moved horizontally, only when it is moved vertically. When immersive mode is broken, the Shield TV regains control of the mouse and keyboard from Moonlight for a moment as well.

Is there anything that can be done to prevent this behavior in the Moonlight app or is this system behavior? Ideally I'd like to remove all triggers that would cause the immersive mode to be broken by the mouse and replace them with a single weird shortcut key combo or something. The device is rooted, so I can change whatever needs to be changed. Does anyone here have any recommendations?

cgutman commented 7 years ago

It sounds like several issues are at play here.

  1. When you flashed the unofficial ROM on your Shield, that removed the mouse capture extensions that NVIDIA provides as part of the stock ROM. Moonlight typically uses these for non-root mouse capture on Shield devices.
  2. You're using the Nougat mouse capture provider which basically just hides the cursor and that's it (because that's all Nougat can do). Moving the cursor outside of the Moonlight window causes it to interact with the System UI. It's bad enough that I should probably just remove it at this point since Oreo supports mouse capture properly.
  3. You're not using Moonlight for Rooted Devices or it's not getting root permissions correctly

Are you running the rooted version of Moonlight (Moonlight for Rooted Devices)?

The-Funk commented 7 years ago

That is a perfect description of my problem. What I've done as a pseudo fix is completely remove the navbar using buildprop editor to prevent the mouse from interacting with android on the bottom of my screen. If I could kill the status bar too I'd be set but that sounds like the duct tape and WD40 fix considering, from what you've said, it sounds like I just need to reinstall an extension or two.

I am using the Moonlight for rooted devices app. Under app settings its permissions are greyed out.

cgutman commented 7 years ago

The mouse capture APIs are provided by the Android framework, so modifying them, even on a rooted device, will be difficult.

The root version of Moonlight is supposed to ask for root permission when you establish your first connection to start the root-based mouse capture process. If it's not doing that, there's probably something wrong with Moonlight or your SU app. Did you ever get asked to grant root access to Moonlight? It won't show up in the stock permissions app because it's not a normal permission.

The-Funk commented 7 years ago

It did ask for permissions I believe, but just to be sure, I'll reinstall it and grant them again and let you know what happens.

The-Funk commented 7 years ago

I reinstalled the application and for some reason it actually doesn't ask for root permissions. I'm going to reinstall the OS and try again because I'm also getting some weird errors here and there after editing a couple too many fields in the build.prop file.

If it still doesn't ask for root access, is there a means to manually specify to run it as root? If I opened a terminal emulator and typed su, could I run it as root from there? Not quite used to the inner workings of Android yet, but it's Unix based so there's always a workaround!

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.