FocusIn / FocusOut is not generated

Can someone please clarify the default focus handling for X11 server? I understand that focus "follows the mouse" and of course if I move the mouse between the individual terminals I can see the cursor change as each window grabs / loses focus.

But when I launch two xev windows and move the pointer between them, I see a lot of MotionNotify / EnterNotify / LeaveNotify as the pointer moves from one window to another, but FocusIn and FocusOut are nowhere to be seen. Is this an oddity in xev? Is there some special mask or property that needs to be applied to create these events?

Thanks a lot, R.

Until I fully understand the answer, I am grateful to the parker, minitech and anyone else who may have stopped.

Thanks again, R.

+1


source to share


1 answer


Focus refers to the window that receives keyboard input when a key is pressed.

Focus handling depends on your window manager. The most common mode is Click to Focus, which your window manager is set to, where you only focus when you click on the window. The alternative is that the keyboard focus follows the mouse, which is what you expect.

There should be a setting to change this in the window manager settings.



Changing the cursor does not indicate focus, the terminal has just defined another cursor.

To demonstrate, open a terminal and an xev window.

  • Click on xev window and press key, you will see key events.
  • Move the mouse to the terminal window, you will see the motion and exit events
  • Press the key and you will still see key events from xev
  • Click on terminal window, xev will give focus event
  • Press the key, the characters will be displayed in the terminal window.
  • Hover your mouse over the xev window and press the key, the character will still appear in the terminal window
+2


source







All Articles