-
Notifications
You must be signed in to change notification settings - Fork 44
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
switching desktop causes focused window to blink in taskbar #59
Comments
I'm aware of this. I actually haven't seen it in awhile since I've been using Desktop View for everything. It's so much easier this way because you can go to the exact window that you want. I don't use the hotkeys for moving windows either because even that is easier in Desktop View. I do understand that others may prefer the hotkeys so I will investigate deeper as to why this is happening so I can address it before it interferes with your work. I think it has something to do with the focused window. That's why I'm not seeing when using Desktop View because with that I am explicitly setting focus to a window. |
You say it is happening a lot with you though. While I have seen this, it was never a lot. Just once in a while. I have been able to reproduce this when quickly switching desktops so perhaps you are switching desktops too quickly. Nonetheless, I will get to the bottom of it. |
I think I have this fixed. I'll release version 1.0.48 in a little bit. Let me know if you still experience any issues. I'll leave this open until you confirm it has stopped. |
To fix this bug you need to kill focus for all of the windows on the desktop that you are leaving.
|
It happens less frequently now, but it's still there. Sometimes a window will flash once and then stop. There's a new problem now though: Sometimes when I switch desktop the active window loses focus. I have to click or alt+tab into it to restore the keyboard focus. |
When you switch desktops there is no active window. Your active window was on a different desktop. If you're trying to get to a specific window on a desktop then you would be better off using Desktop View. I'll look into your new issue of losing focus. I've been unable to make a window flash since yesterday's update. |
Of course when I say "active window" I'm referring to the window that's active on the desktop I've switched to. I've experimented a bit to see where the keyboard focus goes, but as far as I can tell, nothing is focused at all. If it helps you reproduce the problem - I've created hotkeys to switch to specific desktops and am using those. I.e. "Navigate to Desktop # 1" and "Navigate to Desktop # 2". |
Thanks, I will try and fix this. So basically, you want the last active window on that desktop to become the current active window? |
That's right. That's the default behavior, isn't it? Windows maintains the keyboard focus for each desktop. If I use the builtin Windows hotkeys to switch desktop, it works as expected. It's only if I use zVD hotkeys that the focus disappears. So I don't think you need to implement anything; if you just change the desktop and do nothing else, Windows should take care of the rest. |
ok, Sounds simple. I should be able to resolve this tonight. |
In my testing I have successfully reactivated the last active window for each desktop. However, I am unable to reproduce a flashing window or a window whose taskbar button leaks into the wrong desktop after switching. |
Something very odd happens now. Continuing from my Steam/Firefox example, say Steam has keyboard focus. When I switch desktop, Steam keeps the keyboard focus even though it's on a different desktop. If I press buttons and then switch back to Steam, all the letters have been typed into the steam chat. I have discovered something that might help you reproduce my problem with flashing windows. It seems to happen only if the currently active window (before the desktop switch) can have the keyboard focus. For example programs like Notepad, Steam chat and Firefox. If the active window is an app like Explorer (or if there is no active app, i.e. the Desktop is focused) it doesn't happen. So I think you can reproduce the problem if you open Notepad on 2 desktops and switch between them. P.S.: Now that the error with the "go to next desktop" and "go to previous desktop" actions is fixed, I've confirmed that they also cause this issue. |
I'll check this out this evening. |
I was able to reproduce this using Notepad, but only if no window was selected before switching and then switching back. I added some code that I will be testing in a little bit. This code sets the focus to the desktop if you don't have a window to focus on. This could mean an empty desktop or a window wasn't focused before you left the desktop. |
Just checking the app out. I have this issue a ton. Driving me crazy. |
Yeah it sucks. I'm looking for a solution. It does not happen to me at all when I use DesktopView which is really the only way I switch now anyway. I haven't stopped looking for a solution though. If you have any ideas how to handle then let me know. |
I wonder if Microsoft is aware of this issue and is why they don't have a hotkey to move windows from one desktop to another. Virtual Desktops is not fully documented and this means there is likely going to be changes. It would't surprise me if they created a view just like DesktopView. |
I'm pretty certain this has something to do with focused windows so I'm going to try something to fix it. When you use DesktopView, you change the focus to DesktopView. This is why it doesn't happen when using that method. |
You mentioned that you are killing focus when you leave. What if you tried to do that again when you came back? |
it's worth a shot. I was going to try and create a hidden window and give that focus. I'll report back here to inform you how it goes. If I feel good about it, I'll give you a link to a version for you to try. |
@m0ngr31 Ok, instead of creating a new hidden window I decided to use the settings form since it is always there just hidden. By setting focus to the settings form before switching desktops I seem to have solved this. You still may get a blink but it should quickly stop. Please note that if the settings window is visible when you switch then you will cause this issue to appear, so don't do that. Use this to get an updated version and let me know if it works ok. |
Same issue :/ |
Yes, I can still reproduce it too. I am now forcing the flash to stop. It's the flashing that keeps it around so if I can stop the flashing then I can stop the window from leaking into another Desktop. Try out the fresh compilation: Yes, same link |
Hey that works pretty good. How are you forcing it to stop the flashing? Occasionally an app icon will show up, but it's not flashing anymore, so that's great. |
I can make it flash if I wanted to lol. We don't want that though.
|
Although, it does seem to crash pretty easily. Trying to hammer down what the cause is. |
zVD crashing? Visit the Windows log and let me know. You can only get the needed info for a crash from the event logs. I need the stack trace please. It never crashes for me. Not since I handled the memory leak in DesktopView |
Start a new issue for the crash |
I may have fixed the window issue. I'm forcing the Taskbar to get focus and I'm posting a click message to it. |
Does this have the fix for the crash earlier too? |
Seems to. I can't make it crash anymore. And the highlighting apps is gone. Nice job! One small request... If I hold down Ctrl+Win and do left or right, and I can go left and right as many times as I want until I try and do the "round robin". In that case, I have to take my fingers off of Ctrl+Win and go left or right to get to the opposite desktop. Anyway around that issue? |
Sorry, I created that bug just now. Sorry about that. Try the update. |
Closing as fixed as good as it is going to get in version 1.0.63. I might revisit later. |
1) switching desktop causes focused window to blink in taskbar mzomparelli/zVirtualDesktop#59 (comment) so I winactivate the taskbar and then when I arrive at new Virtual Desktop, I emulate alt-tab. 2) Added VD_isValidWindow(hWnd) to only select valid window : It wasn't working for ("ahk_exe devenv.exe") 3) renamed some global vars
Sometimes when I switch desktop, the application that's focused on that desktop becomes highlighted in the task bar.
Example:
On desktop A, I have Firefox:
On desktop B I have Steam (note that Firefox is pinned to my task bar, which is why it's visible on this desktop):
When I switch from A to B, Steam becomes highlighted:
(It's possible to stop the blinking by explicitly selecting the blinking window with the mouse or alt+tab.)
When I switch back to A, Firefox also becomes highlighted (and Steam stays visible in the taskbar because it is highlighted):
This doesn't always happen; I'm not sure if it depends on the programs or where the mouse/keyboard focus is when switching desktops. That said, it happens far too often, to the point where it defeats the point of having multiple desktops at all.
(The problem isn't limited to Firefox and Steam, the same thing also happens with other programs like Explorer.)
The text was updated successfully, but these errors were encountered: