Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Integrated App resize event hook #1676

Open
leaskovski opened this issue Jan 21, 2020 · 4 comments
Open

Feature Request: Integrated App resize event hook #1676

leaskovski opened this issue Jan 21, 2020 · 4 comments
Labels
Feature Request Request for a new feature to be implemented into mRemoteNG Needs implementation

Comments

@leaskovski
Copy link
Contributor

Hi Guys, I have been using external apps to add in VMWare Player VMs into my setup. This works great by increasing the default wait time from 2 seconds to 10 seconds for the VM to start, and then it runs integrated with the mRemoteNG container! What I would like to do though, is get the current resize code that triggers after the external app has been launched, to also trigger when the external app decides to resize itself for some reason.

Expected Behavior

So, I would like a setting that can override this behaviour, because it might be that some external apps, need to resize and be left alone. For when this option is enabled for an external app that is being run in integrated mode, when mRemoteNG then launches the process and gets the handle, it should then also set an event hook up, so that if the external app is resized, the mRemoteNG resize code can trigger and resize the app back to fill the container.

Current Behavior

At the moment, because this doesn't happen, and app is launched with one size, and then once it finishes its loading, it resizes to some other size which means the application then doesn't fill the container. This results in the user having to manually maximize the app to then fill the container to get the integrated look and feel.

Possible Solution

By either using some of the methods mentioned in the StackOverflow...
https://stackoverflow.com/questions/2880160/listening-to-another-window-resize-events-in-c-sharp
It should be possible to get an event to fire when the resize occurs, thus meaning we can then trigger the IntegratedProgram.resize method to get the app to resize to the container again. Note... not sure if this would end up triggering some sort of infinite loop of resize events, so would need to handle this possible scenario.

Steps to Reproduce (for bugs)

N/A

Context

This was found to be annoying behaviour when adding VMWare Player as an external tool with integrated app support.

Your Environment

N/A

@leaskovski
Copy link
Contributor Author

Have started trying to implement this feature in a branch on my fork...
https://github.com/leaskovski/mRemoteNG/tree/1676_integrated_app_resize_hook

@Kvarkas Kvarkas added Feature Request Request for a new feature to be implemented into mRemoteNG Needs implementation labels Jun 21, 2021
@merarischroeder
Copy link
Contributor

I would have thought that the Windows system and the use of Containers would automatically propagate the Resize window events. Therefore, I would assume that the child application (VMWare Client) doesn't handle resizing. But presumably @leaskovski has seen the standalone program work fine for resizing.

So, I have a feeling that MDI resize messages might be different to the normal Window ones. There are Window Event message debuggers you can use to check what messages arrive on a windows handle. I think Spy++ was an old one. If @leaskovski can find such a tool and monitor and report back, we would know for sure.

Otherwise, we can assume the MDI message issue is there and just manually create them and Send them to the Program's main window handle when the mRemoteNG container gets a resize event.

For SSH/Putty, I can see there is a Resize handling function Resize in PuttyBase.cs. This ends up using Native.MoveWindow. This is also already in place for IntegratedProgram. But apparently both of these are only a run-once kind of thing. If Resize on line 135 is also called upon Container.Resize, that might solve this issue.

@leaskovski
Copy link
Contributor Author

I don't have this code anymore, so I am sorry about this. I can't even remember what changes I had made :(

@merarischroeder
Copy link
Contributor

merarischroeder commented Nov 17, 2021

If this can be reproduced simulating with a common program like Notepad.exe or something that would be ideal. It looks like there is no Resize hook at all. Someone can fix it, and hopefully it should work for the VMWare viewer too.

If you're reading this please try a range of common windows tools and see if any work in Integrated Mode. I tried Calc.exe and that didn't work. I haven't tried notepad.exe - your turn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request for a new feature to be implemented into mRemoteNG Needs implementation
Projects
None yet
Development

No branches or pull requests

3 participants