Hazardous input anomaly: Keyboard + mouse input received by wrong window

I’m on Qubes 4.2.4 with the default XFCE desktop environment. I’m now using Qubes as my main daily OS and I love all the new security conveniences I have, but I’ve hit an anomaly that is putting my data integrity at risk.

Occasionally during normal daily use, my mouse clicks and/or keystrokes are directed to the wrong window: I can click buttons and change data in windows that are in the background, on other virtual desktops, or minimized. It initially appeared that some of my windows were randomly freezing, but I eventually discovered that the keyboard events and mouse clicks I did in them were actually being received by some other window and were fully operative there. Given that I can’t predict what effect my inputs will have on a window I can’t see, there’s no upper limit to how much data destruction or other misbehavior this could cause if I’m unlucky.

It shows up intermittently in different places, but I can usually (~75%) reproduce it like this:

  • on 1st Workspace: open a Chromium window
  • on 2nd Workspace: open two windows: Thunar File Manager and mousepad. Click on Thunar so it has input focus and mousepad does not.
  • on 1st Workspace: click in the Chromium window
  • on 2nd Workspace: click in the unfocused mousepad window in an area that overlaps with the screen coordinates of the Chromium window in the other workspace.

If the anomaly occurs, you will notice that the mousepad window appears to be frozen. What’s more concerning is that mouse clicks in it are being sent to the Chromium window in the other workspace as if it were visible on this one: you can press buttons and control Chromium from here, despite its invisibility. It’s as if the Chromium window has refused to relinquish its foreground status and continues to act like it’s being drawn in the foreground on the visible workspace.

Only certain applications will steal input like this: VS Code, Chromium, and Veracrypt do it, but others like Thunar File Manager don’t seem to.

For the record, I have tried and never succeeded in getting this to break qube isolation: all the involved windows are always in the same qube.

I don’t know if this is an issue of Qubes, XFCE, or something else. Does anyone have any ideas?

Hello @hpxk , are all the windows you mentioned (Chromium, Thunar, mousepad…) running on the same VM/qube? I’m trying to reproduce the behavior.

Hi @barto, thanks for looking into this. Yes, all involved windows are always in the same qube. I specifically tried to use this behavior to escape qube isolation and I couldn’t.

I just found another simple process to produce an anomaly that seems related, and may be the same one:

  • In the same qube and on the same workspace, open partially overlapping windows: Thunar and Chromium(or VS Code works too)
  • Click on the Thunar window, bringing it in front of the Chromium window
  • Drag a text file from the Thunar window into the Chromium window
  • Observe that Chromium opens the file and Thunar remains in the foreground. However, mouse clicks in the overlapping area of the Thunar window pass to the Chromium window, allowing text selection or other actions as if Chromium is actually in front.
1 Like

I can reproduce the second process.

1 Like

Me too (:tm:)
It only works with Thunar + Chromium though… substituting Chromium with a Mozilla-flavored browser does not result in the weird behaviour.

I had such kind of issue with xmpp client Conversations, and maybe some other. The problem seems related to to GTK programs.

A common cross qubes problem with those is that when I move the cursor over a different window, I may have tooltips of the previous GTK program being displayed. I’m not entirely sure if it only happens when I switch to a different xfce virtual desktop (so both windows are on different workspaces) or not.

1 Like

GTK seems to be a common denominator, yes :thinking: