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

Refocus on application close is broken with focus stealing prevention #3694

Open
tarek-y-ismail opened this issue Dec 5, 2024 · 2 comments

Comments

@tarek-y-ismail
Copy link
Contributor

Related: #2586

Whenever a window is closed, it's expected that the window visually below it should become the one in focus. But at the moment with focus stealing prevention enabled, an incorrect surface (decoration?) is selected which cannot have focus. This requires the user to manually select the application they want via clicking (haven't tried alt+tab)

@AlanGriffiths
Copy link
Collaborator

I don't think focus stealing prevention is part of this. But as you don't provide a reproducer, it isn't clear whether this is the same thing:

  1. run miral-app
  2. Ctrl-Alt-T to start a terminal [gnome-terminal]
  3. From terminal start kgx [kgx#1]
  4. Ctrl-Shift-N for another kgx terminal [kgx#2]
  5. Rearrange windows in order [kgx#2], [gnome-terminal], [kgx#1]
  6. Close the top window [kgx#2]

Expect: [gnome-terminal] gets focus and order is [gnome-terminal], [kgx#1]
Actual: [kgx#1] gets focus and order is [kgx#1], [gnome-terminal]

@tarek-y-ismail
Copy link
Contributor Author

Oh, sorry for leaving that out.

  1. run miral-app with --focus-stealing="prevent"
  2. Launch multiple terminals.
  3. Close the focused (first) one via Ctrl+D

In mir on main, it will automatically focus the window underneath the one we just closed. In mir on control-new-window-placement-in-policies, focus is not properly set so you can't close all terminals by repeatedly pressing Ctrl+D.

Another scenario which might help pinpoint the issue:

  1. run miral-app with --focus-stealing="prevent"
  2. Launch multiple terminals.
  3. Click on each terminal just to set focus
  4. Click on the first one to focus it
  5. Close it with Ctrl+D

You'll notice that the the last window focused before the one you just closed is now focused. If you close it, the window before it, and so on.

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

2 participants