EarTrumpet icon indicating copy to clipboard operation
EarTrumpet copied to clipboard

EarTrumpet steals window focus on resolution change.

Open djc5166 opened this issue 5 years ago • 32 comments

I have MPC-HC/MadVR playing my video files (full screen), madvr changes my output to 1920x1080 for any video files 1080p or lower (3840x2160 for the rest).

Whenever playing video files that cause the resolution to change, I can verify EarTrumpet is stealing focus (verified with http://www.happydroid.com/focus), I then have to click the mouse on the full screen video window to return focus to MPC-HC, none of my keyboard controls work until then.

Exiting EarTrumpet from the tray resolves this issue, further pointing to it stealing focus.

djc5166 avatar Dec 29 '19 21:12 djc5166

@djc5166 Can you provide the versions of Windows 10, MPC-HC, and MadVR you're using? I'm on Windows 10 1909 (18363.535), MPC-HC 1.7.13 (e37826845) with MadVR v0.92.17 and can't reproduce this behavior.

Do you have the EarTrumpet full mixer window open? Or is it just sitting quietly in the tray? Can you also grab the troubleshooting data in EarTrumpet > Settings > About? Thanks!

riverar avatar Dec 31 '19 07:12 riverar

Windows 10 1909 (18363.535) MadVR v0.92.17 MPC-HC (64-bit) (codecguide.com): Version: 1.9.0 (bfaf63b3b)

In MadVR, for 4k content i use '2160p23', for 1080p or lower I use '1080p119', the switch to/from my native 3840x2160 into the 1080p119 seems to trigger ET to steal focus. ET is just sitting unselected in the tray.

I have a lot of VFR content at <1080p, so ~120hz seems to be the best way to play them, MadVR's 'smooth motion' makes a bit of a mess out of that stuff for me. tmpC9CA.tmp.txt

djc5166 avatar Dec 31 '19 20:12 djc5166

@djc5166 Thanks, can you reproduce the issue, then immediately collect EarTrumpet diagnostics? This will ensure we have fresh data to work with. Also, is EarTrumpet configured with any hotkeys?

riverar avatar Jan 01 '20 21:01 riverar

Sorry I had actually lost access to this machine, had to RMA some parts. It was taking a long time to get them back because of delays due to COVID. But I am able to get this to happen on my main machine in a different but similar situation.

I have just bought DragonAge2 on steam, sometimes when launching it I get the same focus stealing that I experienced with ET vs MadVR.

I'm not sure if it is -exactly- the same issue, or it might just be DA2's fault, but its still strange i see ET popping up here, it definitely has a similar signature.

Whenever I can rebuild my HTPC machine I will go back and reproduce the original issue for you and grab the logs.

Here is the log taken immediately after ET is stealing focus (DA2 is still running).

ET Focus log.txt

focus log (don't know if you actually need this, but this is how I can see ET is infact stealing focus):

15696:D:\Steam\steamapps\common\Dragon Age II\bin_ship\DragonAge2.exe | Mon Jun 15 04:20:00 2020 2900:C:\Program Files\WindowsApps\40459File-New-Project.EarTrumpet_2.1.7.0_x86__1sdd7yawvg6ne\EarTrumpet\EarTrumpet.exe | Mon Jun 15 04:20:07 2020

djc5166 avatar Jun 15 '20 08:06 djc5166

Did these help at all?

djc5166 avatar Jul 15 '20 18:07 djc5166

I finally tracked down my focus-stealing problem to EarTrumpet. When launching the (very old) MMO Lord of the Rings Online, if I have EarTrumpet running, it immediately bounces back to the desktop. I am running at 4k desktop resolution, and I have to run LotRO at 1k.

I think it might have something to do with the scaling, with EarTrumpet reacting to scaling changes. Let me know if you need logs from me. This is reproducible on my system, as long as the problem is happening. (Sometimes it does not, for no readily discernible reason.)

renbear67 avatar Aug 16 '20 03:08 renbear67

Great someone else is having a similar issue, can we have someone look at this?

djc5166 avatar Aug 18 '20 22:08 djc5166

If you can provide step-by-step instructions on reproducing this, happy to take a look.

riverar avatar Aug 18 '20 22:08 riverar

tmpF4B6.tmp.txt

Here is some logs right after the original issue, I dont think I ever grabbed them. My machine is back up and running now.

I will have to come up with some exact steps.

djc5166 avatar Aug 18 '20 23:08 djc5166

It seems to be any madVR profile that changes from your desktop resolution. Either 3840x2160 to 1920x1080 or vice versa.

Also this is the same thing happening with DA2, and I would guess the same thing with renbear's situation.

djc5166 avatar Aug 22 '20 21:08 djc5166

I have the same problem unfortunately, with a bunch of games, because I use a 4k screen, but play most games in 1080p for performance reasons. It doesn't seem to happen with every game, though.

If you want to give reproducing another try, I'd recommend trying a bunch of games and setting them to exclusive fullscreen mode at a lower resolution than your monitor provides. Like 720p on a 1080p screen.

I can kinda "fix" the issue by really, really quickly moving the mouse to where the fullscreen "window" opens, and clicking frantically. That's quite annoying though, especially when I tab out and into the game several times. For now I just gotta avoid EarTrumpet unfortunately, although I really loved it to death for how quick it gets me to the mixer and mute options.

I found the source of the problem with a little program called Focus Logger btw.

3941 avatar Nov 27 '20 22:11 3941

I have the same problem unfortunately, with a bunch of games, because I use a 4k screen, but play most games in 1080p for performance reasons. It doesn't seem to happen with every game, though.

If you want to give reproducing another try, I'd recommend trying a bunch of games and setting them to exclusive fullscreen mode at a lower resolution than your monitor provides. Like 720p on a 1080p screen.

I can kinda "fix" the issue by really, really quickly moving the mouse to where the fullscreen "window" opens, and clicking frantically. That's quite annoying though, especially when I tab out and into the game several times. For now I just gotta avoid EarTrumpet unfortunately, although I really loved it to death for how quick it gets me to the mixer and mute options.

I found the source of the problem with a little program called Focus Logger btw.

it's the same way on my machine, turns out that is this app minimizing the foreground app when it enter fullscreen. did't expect this. but after upgate to the latest version of EarTrumpet the issue was gone for me.

Aspari-Lore avatar Apr 02 '22 06:04 Aspari-Lore

Well that's great news, because indeed I chose to stay away from EarTrumpet for the time being. I'll give it another try. Thank you very much for the update!

EDIT: After a few days of usage, it seems to be just fine. Thanks again for the update. I suppose this can be closed, if anyone's still reading.

3941 avatar Apr 02 '22 06:04 3941

Still occurring for me even with the latest dev version with The Sims 1 and other games :(

Using version 2.2.2.0 from the Windows Store

mrpenguinb avatar Apr 27 '22 12:04 mrpenguinb

image

This is what happens when it steals focus, the dropdown gets all weird. Only occurs once and the focus stealing issue goes away. The dialog returns to normal with no focus stealing after restarting EarTrumpet.

Only happens when running applications at less than native resolution. I use a 1440p display at 125% scaling btw, display scaling seems to be the cause.

mrpenguinb avatar Feb 08 '23 22:02 mrpenguinb

I've been using EarTrumpet again for maybe around 2 week or so, and SO FAR I haven't encountered any issues. But most games nowadays use borderless fullscreen and stuff, so I can't even really tell if an actual fullscreen game is still conflicting with EarTrumpet.

3941 avatar Feb 11 '23 06:02 3941

I can confirm that, I used http://www.happydroid.com/focus and EarTrumpet stealing focus of my full-screen apps, they are set to 1920x1080 resolution. Also got same issue like mentioned here: https://github.com/File-New-Project/EarTrumpet/issues/453#issuecomment-1423311450

hguy23 avatar May 22 '23 13:05 hguy23

@riverar I am using version 2.3.0.0 currently To recreate the issue display scaling in Windows must be set to 125% or higher and the game(s) must run fullscreen!

  • Restart EarTrumpet and DO NOT click on the EarTrumpet icon in the taskbar
  • Run a game that forces the display/desktop to run at a lower than native display resolution, the game will minimize and focus is stolen once. Returning to the game will work.

Now that EarTrumpet has the visual glitch (shown in image I posted previously), it won't steal focus again until EarTrumpet or Windows is restarted fully. I'm not sure if Fast Startup interacts with this bug, regardless I don't have it enabled FYI.

mrpenguinb avatar Sep 29 '23 01:09 mrpenguinb

I'm on, uhhh.... 2.2.2.0 and I've never had ANY issues for a LONG time... I wouldn't presume anything has changed, though.

3941 avatar Sep 29 '23 01:09 3941

Ok, just discovered that at 100% display scaling (restarting EarTrumpet each time) that EarTrumpet that does not steal focus. Focus stealing for me only happens when at 125% display scaling or higher (set in Windows' Settings app) and when games run in fullscreen.

Seems EarTrumpet doesn't like having to switch display scaling and focus at the same time if it's taskbar icon isn't opened at least once.

mrpenguinb avatar Sep 29 '23 01:09 mrpenguinb

Hm... I'm using scaling.. Care to say what game it is that's giving you trouble?

3941 avatar Sep 29 '23 02:09 3941

Need for Speed Most Wanted (2005), The Sims 1, TrackMania Nations Forever, Half-Life 2 (Steam version) etc.

Just make sure to set any game to a resolution lower than your display's native resolution, and that they are not windowed or running in borderless fullscreen/windowed (must be running fullscreen)

mrpenguinb avatar Sep 29 '23 02:09 mrpenguinb

Interesting, will try that here with your additional steps and scaling. And you're on Windows 10 or Windows 11?

riverar avatar Sep 29 '23 17:09 riverar

Interesting, will try that here with your additional steps and scaling. And you're on Windows 10 or Windows 11?

Windows 10 22H2

mrpenguinb avatar Sep 30 '23 01:09 mrpenguinb

@riverar Can you take a look at reproducing this?

mrpenguinb avatar Jan 13 '24 00:01 mrpenguinb

Will do today, thanks for the ping. If we can reproduce this, it's likely a Windows bug. Fingers crossed it's something we can help mitigate.

riverar avatar Jan 13 '24 00:01 riverar

Reproduces on Windows 10 19045.2006. @mrpenguinb can you confirm this is what you see?

https://github.com/File-New-Project/EarTrumpet/assets/475132/fe64c374-bd83-4a92-94da-10e0889ccd6c

riverar avatar Jan 14 '24 00:01 riverar

As reported, if EarTrumpet is opened more than once, the problem does not occur.

https://github.com/File-New-Project/EarTrumpet/assets/475132/9c313120-28e5-4d51-a288-6e5496b66356

riverar avatar Jan 14 '24 00:01 riverar

WPF is calling SetWindowPos on our window when DPI changes, without the SWP_NOACTIVATE flag 🤦‍♂️

Tracking issue: https://github.com/dotnet/wpf/issues/7561

riverar avatar Jan 14 '24 01:01 riverar

Reproduces on Windows 10 19045.2006. @mrpenguinb can you confirm this is what you see? 2024-01-13.16-20-43.mp4

Yup, you got it!! :D Glad that the issue has been cornered. Now to wait for a fix from WPF......

mrpenguinb avatar Jan 14 '24 04:01 mrpenguinb