GUI goes blank on remote desktop - windows

I wrote a compiled MATLAB GUI that we run on a remote machine via Remote Desktop. Overall it runs fine, but sometimes the GUI will blank out many of the control objects (buttons, table, popups). It seems to happen after the screen of the client computer has been locked or after the GUI has been minimized.
If you move the mouse over the buttons, popups, or table headers, they reappear. The table cells will reappear if they are selected. The GUI hasn't crashed and still works fine, but the objects just disappear until you make them reappear again. I have only seen this happen when using remote desktop (Windows-Windows using Remote Desktop Connection).
How can I get this to stop happening? It isn't really breaking anything, but it is very annoying.
I don't know if this is an issue with MATLAB or with the Remote Desktop configuration, so I posted this question here. Feel free to move this to superuser if you think it's more appropriate.

Remote Desktop has issues with handling low level rendered graphics, and interacting with graphics cards. In our experience (we use Nvidia GPU's for rendering and computation engines on multiple projects/applications) we have found remote desktop to fail in so many cases, that we have ditched it for a third party tool.
I suspect this is what you are running into.
One option I would consider, is forcing Matlab to do software rendering, if this fixes the problem, then for certain it's the graphics cards. The first hit on a google search for "matlab software rendering" returns the matlab command opengl. Reading the documentation page for that, gives the command:
opengl software

It sounds like the remote desktop minimization is causing it. For efficiency, Windows will disable various graphics when a Remote Desktop window is minimized on the client computer. To prevent this, create and set a DWORD RemoteDesktop_SuppressWhenMinimized to 2 at the following registry location:
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
After doing this minimizing and locking your screen shouldn't do anything to the RDP session. I doubt it's a graphics card issue, as Windows 10 Creator's Edition allowed remote sessions to use the remote graphics card just like as if you were running locally.

Related

Application temporarily freezes after switching Wi-Fi ON

I am developing a QML (Qt5.15.2) desktop application that is primarily aimed at Windows 10 users.
I have the strangest of bugs that I cannot think of a way to debug, this is kind of a bottle in the sea.
There are some actions that lead to a QML Loader having to load a "big" section of the UI (ex: creating a new tab in the application). These operations are always smooth and does not impact performance in any ways.
But, if I switch the Wi-Fi from OFF to ON and connect to a network, then try to open a tab, the application freezes for 10/15 seconds. This only happens the first time after the Wi-Fi is turned ON, all the other tab opening after the first one are smooth until I turn the Wi-Fi OFF then ON again and try again.
My application does not try to reach the internet, it is purely offline. I get the freeze whether the Wi-Fi network can reach the internet or not. And it only freezes on the first interaction after the Wi-Fi is turned ON, but it is repeatable (every time I turn OFF then ON).
The issue does not appear on wired connection. I could not reproduce the issue on Linux, it only happens on Windows, tested on Intel & Killer network interfaces.
I have no idea what to search for or a way to debug such an issue, I you have any idea on what could cause the issue, what to search for or methods to analyze the behavior it would be greatly appreciated.
This could be caused by a FileDialog, as I remember there were issues with them trying to list files on a network drive.

Is there a faster way to connect to a Bluetooth device from cmd/powershell than btcom from Bluetooth command line tools?

I've put together a Powershell script to allow me to connect my Bluetooth headphones to my PC without having to open the Bluetooth settings page each time (based on the ones in https://github.com/stanleyguevara/win10-bluetooth-headphones, but using Get-PnPDevice and Get-PnPDeviceProperty to check whether the device is connected rather than using an environment variable to save the state).
The script works, but there's one big QoL issue. The script uses the Bluetooth command line tools here to connect/disconnect the device (in particular, it uses the btcom command). However, these commands are very slow to run, with the whole process taking around a minute total. This is true even though I am using the device's MAC address to connect, and not its friendly name (which would be even slower). This makes using the script much slower than just opening the settings panel each time (though opening the settings panel is less convenient since it requires opening and going through multiple windows).
I've seen many questions about this sort of thing (how to connect/disconnect a Bluetooth device from cmd/powershell, but everything I've seen regarding Windows tends to suggest using the Bluetooth command line tools at the link above, so they don't solve the speed issue. Other things I've found suggest disabling the Bluetooth adapter entirely, which isn't what I want to do. Others suggest using the Win+K shortcut to open up the connections sidepanel, but this doesn't really address the question of whether there's a way to do this from cmd/powershell, and is slightly less automated since you have to wait a second for the list to populate and manually navigate to the device to connect/disconnect (though at least it solves the problem of opening a bunch of windows).
Is there a way to connect/disconnect from a Bluetooth device in cmd/powershell that is faster than btcom?

Problem with explorer.exe and dwm.exe in Windows 7 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm using Window 7 Ultimate. I get a problem with two processes, namely explorer.exe and sometimes dwm.exe.
The two processes tend to use cpu between 20-30%.
And it only occurs when i play some game on my PC. My PC works perfect until I play some game.
And another important observation:
They consume no cpu as such but only consumes when I try to refresh my desktop. I mean when I right-click on desktop. It takes seconds for refresh.
I have no virus problems.
I had already tried following things:
Kill explorer.exe and relaunch from task manager. (Problem still persists)
Kill dwm.exe, well it relaunches again. (Problem still persists)
Log Off and Log On. (Problem still persists)
Restart. Problem Solved. (But need an alternative).
Can anyone kindly suggest some quick fixes to the problem?
Those who get the same problem may refer to this question at super user asked by me.
https://superuser.com/questions/254343/window-7-problem-explorer-exe-dwm-exe
My problem solved with ShellExView.
Yeah, this is to be expected. Both of those are critical components of the Windows operating system.
Explorer.exe is responsible for the desktop, the file manager, the taskbar, and most visible components of the Windows shell. Generally, when you're not interacting with a particular application program, you're interacting directly with Windows Explorer. And it's still there in the background when applications are running, managing those applications and the underlying system.
DWM stands for "Desktop Window Manager", which should help to give away what it does. It's a graphical subsystem that was introduced in Windows Vista, and it's responsible for the fancy 3D effects that you get on your desktop now. It drives the "Aero" user interface, so things like glass transparency, Aero Peek, Aero Shake, and a host of other eye candy features are implemented by this process.
Understanding what both of those processes are and what they do should help to explain the phenomenon you cite in your question:
They consume no cpu as such but only consumes when i try to refresh my desktop. I mean when i right click on desktop.
When you refresh your desktop, you're invoking functionality provided by both of those processes. Explorer is responsible for drawing the desktop itself (programmatically, it's implemented as an iconic ListView control managed by Explorer), and DWM is responsible for the graphics subsystem that gets the desktop, in all its beautifully composited glory, onto the screen in the first place.
Using between 20-30% of your CPU is hardly an outrageous draw. That leaves plenty left over for your foreground applications. It's also difficult to monitor exactly what percentage of the CPU those processes are using without altering the results.
But, from the symptoms that you've described, you can be sure that you don't have a virus or anything else wrong with your computer. That's just Windows running, doing its thing. If your computer is struggling to keep up with the game that you're playing, you may need to consider upgrading some of your computer's components (namely your RAM, processor, and/or graphics card).
If you're recently upgraded your computer to Windows 7 from an earlier version (like Windows XP), and have noticed your performance slow down as a result, your graphics card may be struggling under the 800-pound gorilla that is DWM. All of the Aero effects are expensive to run—not a problem for today's overpowered and overpriced video cards that generally sit around doing nothing, but a significant performance hit for older systems that used to run just fine with older versions of the OS. You might try reverting to the Windows Classic theme, which will disable most of the Aero-themed goodness, but will also put some of the "pep" back into your computer's step. Do that by right-clicking on your desktop, selecting "Personalize", and changing your theme to Windows Classic.
Both explorer and dwm are "necessary" files that Windows runs. Explorer.exe is basically all the user interface you see on Windows: the desktop, the taskbar, explorer, etc. Similarly, dwm.exe is the Desktop Window Manager: it governs all the effects that were added with Vista and 7, like the taskbar thumbnails that appear when you hover over a taskbar item, transparency, etc. So it makes sense that you see action on them when trying to refresh the desktop.
I've never actually looked to see how much processing power they use at any given time, so I can't say whether that's excessive or not, but there's really nothing wrong with either one; they probably ought to be running, and unless they're causing undue CPU use, you probably don't need to worry about them. And if you do need to worry about them, then it might be a consequence of your computer not being powerful enough to run Windows 7.
All that said, this isn't really a question for this site. I'm still pretty new here myself, but I think this should be moved to Superuser?

How does UltraVNC achieve "Server Monitor Blanking"

UltraVNC is able to blank the monitor of the computer being remotely accessed. My question is, how is this possible?
In my understanding, due to the nature of the Windows OS, remote desktop applications are limited to remotely displaying only snapshots of the current physical screen. I believe UltraVNC is also subject to this limitation. But, somehow, they have found a way to disconnect the physical screen whilst remotely displaying what it should normally display.
Any idea how this is done?
Use the force, read the source.

How to run arbitrary code when windows resumes from hibernate?

I need to run some code when my computer resumes from hibernate (even before I logon). The laptop I am using has a bizzare problem. If I have an external monitor connected to it while resuming from hibernate the laptop chooses the external display as the main video device and the laptop screen remains blank. This becomes more frustrating when sometimes both displays remain blank indefinitely.
I am thinking of writing some code to switch the active display back to the laptop screen when the computer resumes from hibernate. But which windows event do I need to look for to begin with?
The built in hot keys for switching the display have also stopped working. I have reinstalled the OS several times by now and things go smoothly for a few days after that and then its back to square one.
This article on CodeProject discusses the various Windows messages that relate to power saving events.
I think most laptops have issues with that. It is not something they seem to be able to solve in the drivers/ACPI BIOS.
I know Linux allows you to modify the ACPI tables, but I cannot remember if this is possible on Windows.
A Google should provide links to tools you can use to inspect your laptop's ACPI tables in Windows (MS tools IIRC).

Resources