Hotrian / OpenVRDesktopDisplayPortal

Put your favorite Desktop Window directly into any OpenVR game!
Other
445 stars 97 forks source link

Can't get click events to register #34

Closed treyharris closed 7 years ago

treyharris commented 7 years ago

I'm using the newest 1.0.5.1 alpha (binary release) on Windows 10AU with Vive. I can get the overlay to work, but for the apps I've tried (Firefox and Notepad++), I can only move the mouse sprite around, I can't click. This is regardless of the interaction mode I choose. Besides interaction mode, window, and binding (I've been using controller), I haven't adjust any settings at all.

I've tried this both while running Elite: Dangerous and while just sitting in the default SteamVR environment without any other app running. Any info I can give you to help? The output log is attached. output_log.txt

Hotrian commented 7 years ago

Definitely looks like you ran into some errors

System.ArgumentException: Can't find process with ID 15824 at System.Diagnostics.Process.GetProcessById (Int32 processId) [0x00000] in :0 at ScreenCapture.Win32Stuff.GetFilePath (IntPtr hwnd) [0x00000] in :0

This one shouldn't occur when you select Firefox, if it is, you likely have permission issues.

Can you try launching OVRDDP as Admin?

NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:get_gameObject () at DesktopPortalController.EnableFpsCounter () [0x00000] in :0 at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in :0 at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in :0 at UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) [0x00000] in :0 at UnityEngine.Events.UnityEvent`1[System.Int32].Invoke (Int32 arg0) [0x00000] in :0 at UnityEngine.UI.Dropdown.set_value (Int32 value) [0x00000] in :0 at DesktopPortalController.RefreshWindowList () [0x00000] in :0 at DesktopPortalController+c__Iterator7.MoveNext () [0x00000] in :0 UnityEngine.MonoBehaviour:StartCoroutine(String, Object) UnityEngine.MonoBehaviour:StartCoroutine(String) DesktopPortalController:StartRefreshing() ApplicationDropdownScript:OnDestroy()

This one shouldn't happen at all, not sure why it did.

Looking into it, but I'm super sick today so not sure what I will get done :(.

Hotrian commented 7 years ago

If launching as Admin doesn't work, can I send you a build with a PDB file? These files are used for debugging and I believe they'll give proper line numbers in the error log, as opposed to every error saying it's caused by line 0... What OS are you using btw? Edit: Just realized you said you are running W10AU.. As I said, I'm pretty sick atm..

Hotrian commented 7 years ago

I'm still not seeing how you can possibly encounter the second error

NullReferenceException at (wrapper managed-to-native) UnityEngine.Component:get_gameObject () at DesktopPortalController.EnableFpsCounter () [0x00000] in :0

The only things being called here are values prefilled by Unity when the scene loads. Can you try running 1.0.5 and see if you still get this error? v1.0.5.1 fixes "Full Interaction"'s click mode, but Window On Top and Send Clicks Only should still be able to click Firefox unless there are deeper issues. Can you also try redownloading and reextracting 1.0.5.1? The only way I can see this happening is if Unity's scene file has been damaged, since the scene isn't initializing properly somehow.

Edit: So to be clear, please try

In that order.

If those don't work I'd like you PM you a link to another build that should help me diagnose the issue further, if you're okay with that.

This has been tested in W10 and works great, and I don't expect the AU would break it, but you never know.. I don't know of anyone who has tested this on AU, but I also don't have any kind of survey/diagnostics setup that reports which OSes people are using etc., so I honestly have no idea which OSes other people are using. It definitely seems to be working for other users though, and definitely works on Firefox for me last time I checked.

treyharris commented 7 years ago

Running as Admin worked! Thanks.

Hotrian commented 7 years ago

Thanks for the update! I think this will happen any time the target application has a higher security level than OVRDDP. I believe I can flag OVRDDP so it always launches as Admin but this might seem annoying to some users or make them question the safety of OVRDDP, which why I haven't done it yet.

Hotrian commented 7 years ago

After further research, Unity overrides all of the traditional methods for flagging an application as "Admin Required", so I can't actually automatically require Admin permission. What I could do is add a launcher that automatically launches OVRDDP as Admin (requesting permission through the UAC, of course), but that's probably unnecessary as I just need to get the word out that you must launch as Admin for full support (which is as easy as Right Clicking > Properties > Compatibility > Run as Admin, for those who want it to launch that way every time).

There is a little trick where you can mess with the registry to flag an application as "Compatibility > Run as Admin" automatically, but I think that would be going overboard (and said 'trick' requires the application messing with the registry to be launched as admin anyway). I'd prefer not to mess with the registry either way :P.