-
Notifications
You must be signed in to change notification settings - Fork 103
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
Implement focus stealing prevention #2586
Comments
We might be able to do something to prevent focus stealing, but fwiw the problem exists in sway as well. Easiest solution is probably to run mate-notification-daemon, which I ported to layer shell a while back. |
Looks like it wants to be DBus-activated, as it silently exits a few seconds after starting... |
It won't have access to |
Bingo! I've modified the bug to talk about focus stealing prevention only. |
Well, assuming we don't want to allow zwlr_layer_shell et alias to all applications Miriway needs a way to "whitelist" such services. (Might nor might not be a Mir issue too) |
Quick reformulation of the issue: As we have xdg-activation implemented now, there's no need to automatically focus and bring new windows to the front. xdg-activation can then raise and focus windows when it's appropriate. I've tracked what's needed down to two places, these may not be the proper places to modify, but are a start:
Modifying these two pieces of code to not automatically focus and push new windows to the front should allow xdg-activation to do so when it's appropriate. What's missing: Creating and passing some sort of strategy down to control the behavior depending on whether xdg-activation is available or not. One approach could be using As for X11 applications, those are another can of worms. Now we need the logic to also depend on the app type (wayland vs X), and figure out how XWayland handles this. |
One thing I'm realizing re-reading xdg-activation-v1 is that it only applies to applications launched from other applications. So at the moment with the changes mentioned applying to all applications, applications launched through shortcuts will not start focused (can be worked around) |
Opening links is launching (or activating, if already running) applications from other applications. That just requires things to work together and pass the token further. This was actually the use case Matt implemented activation for. |
Oh I think I should've elaborated more. I didn't mean URLs when I mentioned shortcuts. I meant Mir's shortcuts (CTRL+ALT+T for example) |
Yes, we need to update our launch code to supply a token we respect |
Played around with it for a bit, this is not the way. Edit: Crisis averted. This modification doesn't break literally everything using the stack now @@ -106,7 +106,7 @@ auto ms::ApplicationSession::create_surface(
auto surface = surface_factory->create_surface(session, wayland_surface, streams, params);
auto const input_mode = params.input_mode.is_set() ? params.input_mode.value() : input::InputReceptionMode::normal;
- surface_stack->add_surface(surface, input_mode);
+ surface_stack->add_surface_below_top(surface, input_mode);
if (observer && observer_executor)
{ |
Spent a fair bit of time trying to figure out a way to propagate the information that At the moment, I'm a bit lost how to do this with Anyway, once this is done, we'll need to cover two more things (in addition to the stuff mentioned a couple of comments ago):
|
I think this approach is problematic: We have APIs that allow shells fine grained control over enabling extensions (c.f. I would reverse the dependency: if "focus stealing prevention" is enabled in miral, then force |
Or even, just allow the options to be independent: even if not the desired end state, that makes experimentation easier |
That may well be the best — |
Spent some time passing things ( After that, Alan, Sawicz, and I spent some time discussing whether I was going the right way and using Mir's existing customization options properly or not (hint: I was not). So, seeing how alt+tab did something similar to what we did, we agreed that this was a good place to start and figure out if I spent some time reading through c2553c5 to get a basic idea how alt + tab was implemented, figured that As of right now, this is done with a few lines in |
I'm running Thunderbird under Miriway (same issue with notifications from websites in Firefox). The notification surfaces (part of the problem is lack of a notification manager) show in random locations on the screen, incorrectly cropped and steal focus.
There may be nothing that Mir can do visually, if those are simply top-level surfaces - but focus stealing prevention is something we need to do. May need a separate issue?
Using this Miriway config:
The text was updated successfully, but these errors were encountered: