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

Issues returning focus to last window #27

Open
PhilipNelson5 opened this issue Sep 22, 2023 · 12 comments
Open

Issues returning focus to last window #27

PhilipNelson5 opened this issue Sep 22, 2023 · 12 comments

Comments

@PhilipNelson5
Copy link
Contributor

When changing desktops, the focused window remains on the last focused window on the desktop I just left. I'd expect it to change focus to the last window that had focus before I left the desktop to which I'm returning. Basically, every virtual desktop has a "focused window" which regains focus when that desktop is the active desktop. I've been using 1.4.0 for a while and just upgraded to 2.0.7 but I still see this issue. I see there is a focus-fixes branch, is this issue something you are already tracking?

@widavies
Copy link
Owner

@PhilipNelson5 Yeah, we've had this issue crop up before: #21

It seems to be quite variable - sometimes it works, sometimes it doesn't. When I have some time I'll experiment with a few methods. It seems to be dependent on the Windows version, some handle the focus shift better than others.

@widavies
Copy link
Owner

widavies commented Oct 5, 2023

What Windows version are you on?

@PhilipNelson5
Copy link
Contributor Author

Version 21H2 OS Build 22000.2538

@widavies
Copy link
Owner

@PhilipNelson5 Any better luck on a more recent update of Windows 11?

@widavies
Copy link
Owner

widavies commented Jan 4, 2024

@PhilipNelson5 Try on the latest pre-release here and let me know if it works.

@PhilipNelson5
Copy link
Contributor Author

I'm on 2.0.7, 2.0.8 and 2.0.9 immediately crash. Is there a good way to get logs? The terminal that spawns does not stay open long enough to read the output.

@widavies
Copy link
Owner

@PhilipNelson5 If you open Windows Event Viewer and go to the Application section, you should be able to see a Error message for WinJump:

image

@widavies
Copy link
Owner

@widavies
Copy link
Owner

@PhilipNelson5 Is it still crashing? Did you get it to work?

@PhilipNelson5
Copy link
Contributor Author

I actually changed jobs and got a new laptop and haven't been using winjump lately. When I get it setup again I'll keep an eye on it.

@justinhhorner
Copy link

justinhhorner commented Aug 26, 2024

I've been experiencing this behavior as well where switching virtual desktops does not set focus to the previously focused window on the destination desktop.

In addition to the focus issue, every time I switch desktops, I notice a "Program Manager" window appears quickly during the switch.

I'm working on a way to resolve both issues.

Running Windows 11 Version 23H2 (OS Build 22631.4037)

Video

winjump_focus_blink_issue.mp4

Update (8/28/24)

After spending some more time testing it seems this behavior is not consistent and likely caused by something else in my setup. I'm leaving this for now, but will return to it if others report it.

@widavies
Copy link
Owner

widavies commented Sep 3, 2024

@justin-horner I've had the same trouble trying to track down this issue. It's very intermittent and seemingly depends on the specific Windows version and environment, or even time of day.

The Program Manager flashing is a trick I've seen suggested by VirtualDesktop where by passing focus to the program manager, it will pass it back to the active window after the virtual desktop switches. In practice, it doesn't seem to work very well so we could try removing it.

Maybe there's something else in the winuser.h API that we could use, otherwise we will have to wait for Microsoft to make their (internal) Virtual Desktop API not hit this bug.

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