Skip to content

fix: add workaround to reposition maximized windows in rdp scenario - #248537

Merged
Robo (deepak1556) merged 11 commits into
mainfrom
robo/enable_rdp_maximized_windows_workaround
May 13, 2025
Merged

Robo (deepak1556) merged 11 commits into
mainfrom
robo/enable_rdp_maximized_windows_workaround

Conversation

@deepak1556

Copy link
Copy Markdown
Collaborator

Adopts workaround mentioned in electron/electron#47016 behind a runtime argument enable-rdp-display-tracking as a safer opt-in.

@bpasero

Copy link
Copy Markdown
Contributor

Hm....

So why would this not be a user setting but a command line argument if its not passed down to Electron anyway? And would this be something a user has to know or can we do this when we detect remote desktop sessions?

I feel that the logic in native host main service is not at the correct place, that service is for exposing methods to the renderer. A better place to deal with windows in general is probably app.ts or better windowsMainService.ts.

@deepak1556

Robo (deepak1556) commented May 9, 2025 •

Copy link
Copy Markdown
Collaborator Author

So why would this not be a user setting but a command line argument if its not passed down to Electron anyway?

Wasn't sure. Can make it a setting.

And would this be something a user has to know or can we do this when we detect remote desktop sessions?

Yeah this has to be advertised. There is no signal exposed from runtime today to know if session is rdp but even if exposed it won't play well with this workaround due to a race condition that the session detection in the runtime needs to happen on a different task runner https://issues.chromium.org/issues/416535750#comment2

I feel that the logic in native host main service is not at the correct place, that service is for exposing methods to the renderer. A better place to deal with windows in general is probably app.ts or better windowsMainService.ts.

Thanks! will update them.

@bpasero

Copy link
Copy Markdown
Contributor

Robo (@deepak1556) for me to understand, is this a temporary workaround until a real Electron fix lands?

@deepak1556

Copy link
Copy Markdown
Collaborator Author

@deepak1556
Robo (deepak1556) force-pushed the robo/enable_rdp_maximized_windows_workaround branch from 3e579a4 to c24084d Compare May 12, 2025 10:02
@deepak1556

Copy link
Copy Markdown
Collaborator Author

Flag in action

2025-05-12.19-10-50.mov

@deepak1556
Robo (deepak1556) marked this pull request as ready for review May 12, 2025 10:16

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one more ask: not a big fan of exposing maximizedWindowState from the window as its very specific to this problem and might be used misleadingly in other contexts.

Can we move the entire handling of a display being added into the code window actually? I think then everything is nicely put together: the code that remembers the maximised state and the code that applies it when needed.

@deepak1556

Copy link
Copy Markdown
Collaborator Author

Can we move the entire handling of a display being added into the code window actually?

Would that mean replicating the logic separately for aux window since that doesn't extend code window.

@bpasero

Copy link
Copy Markdown
Contributor

I think not, it both extend from it:

export class AuxiliaryWindow extends BaseWindow implements IAuxiliaryWindow {

@deepak1556

Copy link
Copy Markdown
Collaborator Author

Okay I was confused when you meant code window, thought it to be ICodeWindow.

@deepak1556
Robo (deepak1556) enabled auto-merge (squash) May 13, 2025 13:56
@deepak1556
Robo (deepak1556) merged commit 1f48d57 into main May 13, 2025
@deepak1556
Robo (deepak1556) deleted the robo/enable_rdp_maximized_windows_workaround branch May 13, 2025 16:27
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jun 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants