-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Voluntary window switching inside VM #1455
Comments
I've seen this few times, but haven't investigated details. Thanks! Generally focus stealing prevention is a hard task - see #1166 for details. But I don't think we should abandon it completely. So in case of the same VM, the task is easy (in theory). In case of inter-VM, it isn't so obvious. Maybe it should be left for window manager decision? If no other arguments there, I think the safe default would be to deny such inter-VM switch (maybe configurable option). I'm assigning milestone R3.1, but in practice I think we will not manage to implement this before R3.1-rc1 (so final R3.1, as it requires protocol modification). |
BTW, do you know the cause? I hope I know it, but I don't want to explain you my hypothesis about something you already know. I hope it might be implemented without protocol change in some lighter version. The behavior described in expected behavior under letter b seems not to require any protocol change. It is also less considerably less confusing than the current state (at least for users who don't know the background of the issue). The inter-VM case is harder than it might look, because any launching any application from dom0 (or from some domU through some RPC) will inherently look like an attempt of focus stealing. This could be prevented by some policy, which temporarily allows any focus stealing (either by opening a new window or by focusing an existing window) until at least one of following conditions becomes true:
These three rules could be probably simplified while achieving a very similar (or even slightly better) result. The idea behind that lies in using some WIP indicator for app start. That is, when the user attempts to start an application, dom0 would immediately open a window informing about WIP. The window would be closed after first window is opened by the application. Despite being opened from dom0, the window would be considered as a window belonging to that AppVM. (Maybe it would get the same window class in order to have the same WM's rules applied.) This would have multiple benefits:
There are some potential issues or tunable things (sorted by perceived importance):
Of course, I mention dom0, but it might be a separate UIVM in a future release. BTW, should I discuss inter-VM focus stealing there, or move this part of discussion to another issue? |
On Wed, Nov 25, 2015 at 02:34:15PM -0800, Vít Šesták wrote:
I think you've already named it. VM have no (direct) control over focus in dom0. But key/mouse events are passed to the VM as a whole (as qubesdev input device in VM), while trying to keep input focus at the same window in both dom0 and VM. If, for any reason, focus in VM is switched to some other window without explicit dom0 request (which in most cases matches what VM applications wants) - that may lead to entering keys/mouse events to a wrong window. Hmm, actually there was some code to send events specifically to window which received the event at dom0 side (each event carry this information), even if it isn't currently focused window. I'm not sure why it was disabled - that was on some early days of Qubes.
Theoretically you're right. But in practice there are few problems with it:
|
Hmm, interesting. I guess this will not be so wasy to just enable it…
Theoretically yes. However, I've seen such cases rather for newly opened popups generated by user interaction.
|
steps to reproduce
geany some-file
.expected results
I would expect one of those scenarios:
a. At step 3, window is correctly switched. At step 4, user interacts with Geany.
b. At step 3, window is not switched. At step 4, user interacts with Terminal. Maybe the Geany window is trying to get attention, which is reflected in the UI in some way.
actual results
At step 3, window is not switched. At step 4, user interacts with Geany, despite the fact that Geany is seemingly not the current window. The Geany window is not trying to get the attention.
thoughts on UX and focus-stealing-related security
From user perspective, I would prefer switching the window in such case.
From security perspective, I see little or no drawbacks:
The text was updated successfully, but these errors were encountered: