vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Pick up latest vscode-markdown-languageserver

Open mjbvz opened this issue 7 months ago • 1 comments

mjbvz avatar May 21 '25 02:05 mjbvz

I also have this error on Win 11 23H2.

The focus is not just lost when using the same shortcut - dismissing the window using escape or by triggering a plugin action set to dismiss the menu also appears to steal focus (focus remains inside the widget, so any typing will be visible when the widget is re-launched).

nathancartlidge avatar Jun 06 '25 19:06 nathancartlidge

@nathancartlidge omg, wow. lol.

https://github.com/user-attachments/assets/a288c5d8-c79a-401a-88cb-5ade8820ef21

That's actually really bad, I can even launch commands without meaning to

TFWol avatar Jun 06 '25 23:06 TFWol

Still broken. Issue isn't even triaged yet...

TFWol avatar Jul 04 '25 04:07 TFWol

This was working properly in 0.90.1 so something must have changed to stop handing focus back to the previous window. This commit looks like it could be the cause -> #39170

CoreyHayward avatar Jul 06 '25 20:07 CoreyHayward

Issue isn't even triaged yet

my bad! I was out for pretty much all the time since Build in late May. I'm still catching up on the triage queue.

I think this is probably the same fundamental issue as #40138. This thread has more commentary in it, so I'll dedupe here.


Moving my earlier comment:

I think I actually know what this is!

This is probably the same thing as what I just tried to fix in ce150322ed0a0e1285ab9af77f03442606f4c813 (in MainWindow.xaml.cs)

This regressed in the DMW_CLOAK PR in 0.91.

When we cloak our window, it doesn't actually toss foreground back to another application. Foreground stays in our cloaked window. It's actually shockingly bad now that I'm looking for it.

In the aformentioned commit, I have a test fix where I just toss foreground at the first non-WS_EX_TOOLWINDOW, but I don't think that's really the right solution here. I'm sure that there's a more accurate way to fix this, but I don't know what it is.

zadjii-msft avatar Jul 07 '25 14:07 zadjii-msft

Hi @zadjii-msft , can you take look at https://github.com/microsoft/PowerToys/pull/40431? I think it naturally solve the issue.

jiripolasek avatar Jul 07 '25 14:07 jiripolasek

@jiripolasek I'm debugging that right now. By all accounts, I think that should work, I just want to test it a bit more.

I originally wrote the fix in ce15032 for #38344. If I use the Hide();Show(); code instead of the FG handoff, it doesn't Just Work, so I'm trying to see what's up

zadjii-msft avatar Jul 07 '25 15:07 zadjii-msft

Yea just hide/show doesn't seem to work for the clipboard. Seems like in that case, it still gets CmdPal as the current FG window. Not great.

But on the bright side, I asked a coworker on the Windows Shell about this, and he agreed that just tossing focus back at the next top-level window should just work. I'll file a PR for that separate from the Clipboard stuff. Thanks for helping drive this though!

zadjii-msft avatar Jul 07 '25 15:07 zadjii-msft