xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Opened 4 years ago

Last modified 4 months ago

#1442 assigned enhancement

workspace support for MS windows 10

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 4.2
Component: platforms Version: trunk
Keywords: win10 workspace Cc: stdedos@…

Description

Split from #774, originally recorded in #776.

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

Attachments (2)

1442_desktop.cs (2.9 KB) - added by Tijs van der Zwaan 6 months ago.
1442_simple_example.cs (1.2 KB) - added by Tijs van der Zwaan 6 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 2 years ago by Antoine Martin

Milestone: 3.0future
Status: newassigned

Links:

Version 0, edited 2 years ago by Antoine Martin (next)

comment:2 Changed 13 months ago by stdedos

There is also #2081's

As reported in ticket: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

comment:3 Changed 13 months ago by stdedos

Cc: stdedos@… added

comment:4 Changed 13 months ago by Antoine Martin

Cc: stdedos@… removed
Milestone: future4.1

comment:5 Changed 13 months ago by stdedos

Cc: stdedos@… added

comment:6 Changed 7 months ago by Antoine Martin

Milestone: 4.14.2
Last edited 7 months ago by Antoine Martin (previous) (diff)

comment:7 Changed 6 months ago by Tijs van der Zwaan

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.

Last edited 6 months ago by Tijs van der Zwaan (previous) (diff)

Changed 6 months ago by Tijs van der Zwaan

Attachment: 1442_desktop.cs added

Changed 6 months ago by Tijs van der Zwaan

Attachment: 1442_simple_example.cs added

comment:8 Changed 6 months ago by Tijs van der Zwaan

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

comment:9 Changed 4 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1442

Note: See TracTickets for help on using tickets.