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

[Q]: Focus stealing prevention feature #109

Open
GHNewbiee opened this issue Apr 25, 2024 · 13 comments
Open

[Q]: Focus stealing prevention feature #109

GHNewbiee opened this issue Apr 25, 2024 · 13 comments
Labels
feature New feature or request good first issue Good for newcomers

Comments

@GHNewbiee
Copy link

Does Miracle-WM provide prevention against stealing of a window focus? Tia

@GHNewbiee GHNewbiee changed the title [Q]: Focus stealing focus feature [Q]: Focus stealing prevention feature Apr 25, 2024
@mattkae
Copy link
Collaborator

mattkae commented Apr 25, 2024

Hiya @GHNewbiee. What would be the feature here? As far as I understand it, I think it would be:

  1. Window A is focused
  2. Another Window B opens and requests focus
  3. Window A should keep focus if the compositor is set to do so

Is that correct?

@GHNewbiee
Copy link
Author

@mattkae Thanks for your response. Just to be more precise:

  1. Window A is chosen and, hence, it gets focused
  2. To add, that any window requiring "attention" eg password, etc, it merely behaves in different manner eg flashing (?)
  3. That's very correct!

@GHNewbiee
Copy link
Author

GHNewbiee commented Apr 25, 2024

To add in 2) Window requiring "attention" should not lock the focus on itself. That's why it has to behave in a different manner if possible.

@mattkae
Copy link
Collaborator

mattkae commented Apr 25, 2024

Understood now! Right now, the behavior is that any window that gets brought up gains focus, but we could just as easily provide an option in the config to disable that behavior.

@mattkae mattkae added feature New feature or request good first issue Good for newcomers labels Apr 25, 2024
@GHNewbiee
Copy link
Author

@mattkae

What about the behavior of a window requiring attention, will it

  • give a kind of "signal", or
  • lock the focus to itself, or
  • be just sent back like a simple/common window?

@mattkae
Copy link
Collaborator

mattkae commented Apr 26, 2024

  • The signal idea would be nice if it weren't for multiple workspaces. If a window required attention on another workspace, then the only way to handle that would be to navigate to that workspace. That being said, we could also use inotify or something and say "Window X on workspace 3 wants your attention"
  • What do you mean by this?
  • The third option would be the easiest, and then it's up to the user to navigate to it. Although it certainly feels the least "urgent"

@GHNewbiee
Copy link
Author

  • I am not sure how practical opening apps/wins in different workspaces at the same time is? I have never had a necessity to do that in my whole life. In addition, changing workspace and clicking to open an app/win takes some time. If you feel that using inotify worths the pain / additional work then it's ok. In addition, the project will provide a unique feature!
  • There is case that a window locks the focus to itself. In that case you cannot move to any other window unless you close the locked one first.
  • That's correct.

@mattkae
Copy link
Collaborator

mattkae commented Apr 26, 2024

  • Yeah maybe that can't happen now that I think of it. I was thinking that an app would spuriously open a window in another workspace, but it would be in the current workspace always. This is actually a void point 👍
  • Ah and is this requested by the client? Is this an X only thing or is there a Wayland protocol that requests this behavior?

@GHNewbiee
Copy link
Author

GHNewbiee commented Apr 27, 2024

Ah and is this requested by the client? Is this an X only thing or is there a Wayland protocol that requests this behavior?

I get this while trying to open Github Desktop. An "Unlock Login Keyring" window appears which locks the operation. I have to unlock by entering the password first before continue working, although I opened it last .

I log in by means of fingerprint.

I still use X. I do not know the process of that .

See photo attached.

IMG-a6ca3d2b86bc35e15113b3d8c63e6f1d-V

@GHNewbiee
Copy link
Author

GHNewbiee commented Apr 27, 2024

To summerize:

  1. A window may need:
  • "attention", or
  • not (standard/normal window)
  1. The focus state of a normal window may be:
  • usual , each new window gets focused
  • retained , (last) chosen window retains focus
  1. The focus state of a window that requires "attention" may be:
  • usual, as above
  • retained, as above
  • locking , first DE gets locked, next a kind of attention has to be given and last DE gets unlocked
  • informative, eg window frame becomes red and/or icon in task bar/panel flashing or its frame becomes red, too.
    Note: informative could be used in conjunction with all three states (usual, retained and locking)

Is there other option ?

@GHNewbiee
Copy link
Author

GHNewbiee commented Apr 27, 2024

Do X and Wayland protocols distinguish normal windows from windows requiring "attention"?

If not, could a kind of existing flag/option to be used instead of?

@mattkae
Copy link
Collaborator

mattkae commented Apr 30, 2024

That is a very good question. I know that X11 had an "urgent" hint for this use case (see: https://notes.secretsauce.net/notes/2014/03/19_x11-urgency-hint-and-notifications.html). I am tracing the Wayland form of this now. It looks like the following happened:

Mir doesn't support that protocol unfortunately. However, this protocol in theory passes focus from one surface to another (although, it says nothing about the urgency of the newly focused surface, but it is implied that it is "very" urgent)

@mattkae
Copy link
Collaborator

mattkae commented Oct 30, 2024

FYI: canonical/mir#3639 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants