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

Last unfocused window in the target Virtual Desktop starts flashing after switching #19

Open
egeozcan opened this issue Dec 31, 2016 · 3 comments

Comments

@egeozcan
Copy link

If the last active window isn't in the target Virtual Desktop (the one we are switching to), the last window which had focus on the target Virtual Desktop starts flashing. This happened to me on version beta3.

Switching via Ctrl+Win+Arrow keys does not show the same behavior.

@drzigman
Copy link

drzigman commented Jan 7, 2017

I am able to replicate this when running my application standalone, however when I run my application with debug from Visual Studio the flashing doesn't occur. Hopefully that'll help track down the cause of this, would love to see a fix or suggestions for a workaround. Thanks for the library!

@egeozcan
Copy link
Author

egeozcan commented Jan 8, 2017

@drzigman the library throws an exception telling to disable debug for me when I run it through VS.

@mzomparelli
Copy link

mzomparelli commented May 9, 2017

To fix this bug you need to kill focus for all of the windows on the desktop that you are leaving before you switch desktops.

SendMessage(this.Handle, WindowsMessage.WM_KILLFOCUS, IntPtr.Zero, IntPtr.Zero);

I handle this in my app that you'll like a lot.

https://github.com/mzomparelli/zVirtualDesktop

statiolake added a commit to statiolake/DynamicWorkspaceManager that referenced this issue Nov 10, 2021
Without unfocusing, the previous window on the previous workspace keeps
focused. This causes all keyboard inputs captured by the previous window
unless I explicitly change focus to the window on the current workspace
(by e.g. Alt+Tab). This is very dangerous --- for example, the text
editor focused previously in the previous workspace still gets keyboard
input, destroying the editing text. Or, the web browser previously
focused still has the focus, inserting random text into the text box on
some web page.

This can be solved by unfocusing all the windows on the previous
workspace before switching.

For reference:
Grabacr07/VirtualDesktop#19 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants