top | item 44837017

(no title)

guardian5x | 6 months ago

Well, sometimes the user expects the focus to shift, like the example mentioned when you click a link in one application and your browser in the background should come into focus when it opens a new tab. Some applications just decide to steal focus when the user does not expect it, and that is the problem.

discuss

order

somat|6 months ago

I am not sure, as a convert to the church of "focus follows mouse" I sort of want well... my focus to follow the mouse and the mouse to follow me.

Now there may be a legitimate case to steal focus, but I am unable to think of one at the moments and your click link example fails to convince me.

I also sort of hate modal dialogs/windows. I think modals are in general an indicator of lazy/bad design. That being said, there are legitimate cases for modals. but "stop the world and handle me" should be a last resort not the first.

TheAceOfHearts|6 months ago

The legitimate use-cases for stealing focus are situations where an immediate response is required and timing is limited. For example: after you queue up for a ranked League of Legends game, there's a timed confirmation popup that appears when 10 players are found and which all players are required to accept before the game moves on to the draft.

In purely software spaces there's usually nothing that urgent happening. If something is really urgent it's usually going to be because it carries significant real-world consequences. Emergency alerts on smartphones are a good example of taking immediate priority over all other activities, especially if it's something like a warning of incoming missiles.

Dylan16807|6 months ago

At the very least you need the ability to show the browser when you send a link to it. And if that overlaps the window you were clicking the link in, then it'll now be under the mouse. Are you happy with that indirect focus steal? If not, I don't think there's a way to align your preferences with the average user.

zamadatix|6 months ago

I'm of the cult of "focus follows mouse" as well but I think the same conversation exists regardless, just not for the specific case you already had your browser window positioned elsewhere from the window your mouse is currently over.

BobaFloutist|6 months ago

If you click a link in one application, surely it should pass focus to the browser, why should the browser be initiating that process?

watusername|6 months ago

Only the invoked app knows whether it needs the focus in the first place. Maybe the link you clicked is supposed to initiate some background processing that does not demand your focus at all.

nottorp|6 months ago

Yes but there's no way for the OS to know if the focus request is legitimate, is there?

Can't even say "browsers are allowed to grab focus" because they'll grab it for a stupid window telling you to update the browser or what new features no one cares about they introduced.

I'd prefer to have to switch focus to the browser manually than have the stupid ubuntu update manager steal focus when i'm typing in the terminal...

elehack|6 months ago

The article is about a mechanism for the OS to validate focus requests. The application with the link requests a focus token, and passes it to the browser along with the open-link request, and the browser can then request focus.

It isn't perfect, because there's no way to know that the browser isn't using the token to request focus for something else, but maintaining and validating chain of custody for focus across applications is exactly the problem it looks like they are working on solving.

Ukv|6 months ago

> Yes but there's no way for the OS to know if the focus request is legitimate, is there? Can't even say "browsers are allowed to grab focus" because [...]

To my understanding, the approach described in the article is that the currently active program requests a token and then passes that along to the program that it wants to take focus. Compositor can also check what triggered the request (mouse click? global keybind?) to decide if the request is legitimate.

That seems reasonable to me, opposed to requiring the user to switch over to a new window every time they `right click -> show in file browser` a file in their IDE, or after they press a hotkey to open a screenshot tool, or so on.