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

workspace support for MS Windows 10 #1442

Closed
totaam opened this issue Feb 15, 2017 · 12 comments
Closed

workspace support for MS Windows 10 #1442

totaam opened this issue Feb 15, 2017 · 12 comments
Labels
client enhancement New feature or request win32 MS Windows OS
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Feb 15, 2017

Split from #774, originally recorded in #776.

Windows 10 apparently has support for virtual desktops, we should detect changes and call suspend / resume.

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2019

Links:

@totaam
Copy link
Collaborator Author

totaam commented Apr 7, 2020

2020-04-07 11:05:05: stdedos commented


There is also #2081's

As reported in #2029#comment:25, Windows 10 Virtual Desktop Enhancer - Home must contain the API calls we need to hook into to be able to detect the current desktop / which desktop a window is on.


Additionally, when

2020-04-07 12:12:02,569 screen size change: will reinit the windows
it would be nice if you made an effort to re-init the windows on the desktop they were originally

@totaam
Copy link
Collaborator Author

totaam commented Oct 8, 2020

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2020

2020-11-19 10:00:38: TijZwa commented


I've build a wrapper around Xpra to obtain this functionality.

For those who are interested:
I use CreateDesktop of User32.dll.
More information on this topic: https://codingvision.net/c-create-secure-desktop-anti-keylogger & https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-createdesktopa

My workflow:

  1. Call CreateDesktop
  2. Remove all open windows/hooks from the thread.
    In my case, I use Eto.Forms, so I just call Application.Dispose() to make sure all the handles are gone.
  3. Call SetThreadDesktop (Warning from the MS docs: The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop)
    This is only necessary if you want to create forms on the desktop. You can skip this step if you only want to launch Xpra.
  4. Call SwitchDesktop (wich makes the desktop visible)
  5. Start Xpra.exe on the newly created virtual desktop, using the struct STARTUPINFO, property lpDesktop)
  6. Wait for the Xpra proces to exit, then switch back to the original desktop.

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2020

2020-11-19 10:07:27: TijZwa uploaded file 1442_desktop.cs (2.9 KiB)

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2020

2020-11-19 10:07:37: TijZwa uploaded file 1442_simple_example.cs (1.2 KiB)

@totaam
Copy link
Collaborator Author

totaam commented Nov 19, 2020

2020-11-19 10:08:24: TijZwa commented


Added a very simple example and the class exposing the used functions.

@totaam totaam added this to the 4.2 milestone Jan 23, 2021
@totaam totaam added client enhancement New feature or request win32 MS Windows OS labels Jan 23, 2021
@stdedos
Copy link
Collaborator

stdedos commented Dec 8, 2021

S'more Virtual Desktop discussions: sandboxie-plus/Sandboxie#1326

@totaam
Copy link
Collaborator Author

totaam commented Dec 8, 2021

@totaam
Copy link
Collaborator Author

totaam commented Jan 30, 2024

Implemented using pyvda, see https://github.com/orgs/Xpra-org/discussions/4055#discussioncomment-7738961.

Caused #4109 - so there may still be something missing in the EXE installer? Something ctypes or com related?

@totaam
Copy link
Collaborator Author

totaam commented Nov 29, 2024

This is now disabled to prevent crashes: #4429 (comment)

@totaam
Copy link
Collaborator Author

totaam commented Dec 15, 2024

Could this be related?
mhammond/pywin32#2415
And the issue may also have been resolved in mrob95/pyvda#52

Worth trying again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client enhancement New feature or request win32 MS Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants