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

All windows share one WM_CLASS #267

Open
awsms opened this issue Sep 23, 2024 · 2 comments
Open

All windows share one WM_CLASS #267

awsms opened this issue Sep 23, 2024 · 2 comments
Labels
bug Something isn't working freerdp Issue related to freerdp good first issue Good for newcomers legacy Using legacy winapps

Comments

@awsms
Copy link

awsms commented Sep 23, 2024

Then I can see the windows decorations in other workspaces:
image

  • Context menus (right-click) are often a black rectangle in various programs (like the Windows Explorer)
@oskardotglobal oskardotglobal added the freerdp Issue related to freerdp label Sep 23, 2024
@AkechiShiro
Copy link

Can you try on SwayVM and report if you have the same issue as on i3WM ?

@fitzmorrispr
Copy link

fitzmorrispr commented Oct 3, 2024

RE WM_CLASS: It's not necessarily a FreeRDP issue. It is probably technically possible for FreeRDP to use WinAPI calls (Such as GetClassName (!)) to query every window's strings, and use those with a lookup table to assign appropriate window classes, but such a table would either have very poor coverage, or would be enormous, and even then it would have edge cases for days, as this is really not the purpose of those strings.

The aforementioned ClassName identifies groups of windows, but not per-application, and the names are only really meaningful to the programmer of the specific app.
So, Excel Userforms (made in the VBE) are either "ThunderDFrame" or "ThunderXFrame" depending on excel version, but the main window is something else, the VBE window is a third thing, etc.

The problem could be worked around by using a Windows Server install with Terminal Services, which then allows multiple RDP sessions per user, and therefore multiple FreeRDP processes each with different WM_CLASS ,but that costs money.

Probably regular windows is capable of doing this too, but the functionality is certainly not made available

RE: the visual glitch issue:
I don't use Visual Studio, so I can't tell you for sure what's going on here, but:

Windows apps can have multiple windows per visible window.
The windows API allows for the creation of single buttons in a dialog box, but crucially, when made this way, each button is actually a full fledged window, with its own window handle. the thing that makes them behave as though they are part of the window they appear with is all API glue, WM_PAINT events and such.

there's also GDI calls for painting outside the normal boundaries (without them, the process is limited to painting inside its window frame)

This all works fine in the windows environment, obviously a desktopless (the windows Desktop is a Window! it has an hWnd and properties!) RDP session in a non-windows environment might not implement every winAPI event, property, and method necessary to avoid glitches like you describe

I'm using XFCE, and my windows explorer context menus work, so there may be wm related issues in play as well, but:

it MIGHT be that those decorations are actually [a] window[s] with their hWndInsertAfter set to HWND_TOPMOST ( = -1) when the vscode window is Active (vscode.hWnd == GetForegroundWindow()), and set to HWND_NOTOPMOST ( = -2 ) or HWND_BOTTOM ( = 1) when the vscode window is made inactive ('vscode.hWnd != GetForegroundWindow()`)

Thing is, switching to a non-windows window cannot trigger the code that triggers on making another window active, because you have to have the handle of a Windows window to call SetForegroundWindow(hWnd)

If this is what's going on, usage of Spy++ inside of a full RDP session would likely reveal it.

@oskardotglobal oskardotglobal changed the title Poor compatibility with i3wm All windows share one WM_CLASS Dec 8, 2024
@oskardotglobal oskardotglobal added bug Something isn't working legacy Using legacy winapps good first issue Good for newcomers labels Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working freerdp Issue related to freerdp good first issue Good for newcomers legacy Using legacy winapps
Projects
None yet
Development

No branches or pull requests

4 participants