macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.53k stars 685 forks source link

New window created from fullscreen doesn't get focus #1244

Open RhvdG opened 2 years ago

RhvdG commented 2 years ago

Steps to reproduce

  1. Run MacVim fullscreen
  2. Hit cmd-N to create a new window (this is created as a fullscreen 'space')
  3. Type something
  4. Notice that what was typed ended up on the first fullscreen window (now not visible), not the new one that should have focus

Expected behaviour

The newly created window (fullscreen) should get focus.

Version of Vim and architecture

8.2, x86_64, patches: 1-3455

Environment

macOS 12.3.1

How MacVim was installed

Homebrew (I think...)

Logs and stack traces

No response

Vim configuration where issue is reproducable

No response

Issue has been tested with given configuration

Issue has been tested with no configuration

Other conditions

dantezhu commented 2 years ago

+1

ychin commented 2 years ago

That's weird, I'm not reproducing this. Does it matter if you wait a bit or immediately start typing when the animation is ongoing (it takes like less than a second to finish the animation)? Also, are you on a multiple monitors or single-screen environment? macOS does have some funky behavior with focus when on multi-screen so trying to figure out if that could be related.

jtiee commented 1 year ago

I see similar behavior with a multi-monitor setup.

With an existing MacVim window on screen 1, run MacVim via a terminal window on screen 2. The new window opens on screen 2, but focus is given to the MacVim window on screen 1.

ychin commented 1 year ago

@jtiee I can see your issue. That said, I'm debating if that's "as designed" per se, because if you look at how other apps work it's actually kind of how they usually behave (e.g. try to do the same with TextEdit or a web browser by right clicking on the dock icon to open a new window on the second screen while the first screen has a full-screen app), but I do agree it's jarring.

I think what you are describing is a little different from the original issue though. I still have not seen a second full screen not being able to focus like that. If the original posters @dantezhu and @RhvdG could post a screen capture video I would appreciate it.

ychin commented 1 year ago

Hmm actually I think I may have misunderstood what you said. You aren't talking about full-screen window but just regular windows. Let me take a look.

jtiee commented 1 year ago

Yes, my note is about the "focus" and not the "full screen" aspect of this issue. Let me know if you'd prefer a separate issue for this.

ychin commented 1 year ago

Yes, my note is about the "focus" and not the "full screen" aspect of this issue. Let me know if you'd prefer a separate issue for this.

Yes I think that's a different issue. Feel free to file it, but I'm not sure if I would do anything on it for now. It's kind of "as designed" depending on how we think about how macOS apps work, but I agree it's a little annoying.